NANCY: Add reserve() calls before initializing arrays
Added calls to reserve() before initializing most arrays in the engine to reduce unnecessary allocations when pushing back elements one by one.
This commit is contained in:
parent
99da486454
commit
bfc6586f78
18 changed files with 72 additions and 23 deletions
|
@ -38,6 +38,7 @@ void CursorManager::init() {
|
|||
Common::String inventoryCursorsImageName = chunk->readString();
|
||||
|
||||
chunk = g_nancy->getBootChunkStream("CURS");
|
||||
_cursors.reserve(56);
|
||||
for (uint i = 0; i < 56; ++i) {
|
||||
_cursors.push_back(Cursor());
|
||||
chunk->seek(i * 16, SEEK_SET);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue