GSdx GSLocalMemory: Reserve space required in the std::vector before adding elements to it.

This commit is contained in:
Alessandro Vetere 2017-05-24 00:04:19 +02:00 committed by Gregory Hainaut
parent 3300470a29
commit f8e89b694a
1 changed files with 3 additions and 0 deletions

View File

@ -699,6 +699,9 @@ vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
}
}
// Allocate vector with initial size
p2t[page].reserve(m.size());
// sort by x and flip the mask (it will be used to erase a lot of bits in a loop, [x] &= ~y)
for(hash_map<uint32, uint32>::iterator j = m.begin(); j != m.end(); ++j)