HomeWildfire Games

Change internals of EntityMap to use an std::vector
Audit RequiredrP22029


Change internals of EntityMap to use an std::vector

This generally makes this code cleaner and easier to maintain, while also being more modern and fully tested.

Looked at by: leper

Differential Revision: https://code.wildfiregames.com/D8


Group Auditors
Restricted Owners Package
wraitiiJan 5 2019, 7:19 PM
Differential Revision
D8: Change internals of EntityMap to use an std:: vector
rP22028: Remove excess argument from shift call
Build Status
Buildable 6730
Build 11068: Trigger Windows Autobuild
Build 11067: Post-Commit BuildJenkins

Event Timeline

wraitii added an auditor: Restricted Owners Package.Jan 6 2019, 2:01 PM
This commit now requires audit.Jan 6 2019, 2:01 PM

The reason for the crash is that find() didn't expect to be called with an entity below FIRST_VALID_ENTITY_ID, i.e. INVALID_ENTITY. This should return end() instead so I need to amend this code.

Inserting stuff before FIRST_VALID_ENTITY_ID should probably still crash so the ENSURE there should be fine.

vladislavbelov added inline comments.


The _ and __ prefixes are reserved for C++/STL, so we should avoid them.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf Global names [global.names]

1 Certain sets of names and function signatures are always reserved to the implementation:
— Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase
letter (2.12) is reserved to the implementation for any use.
— Each name that begins with an underscore is reserved to the implementation for use as a name in the
global namespace.