From f8e89b694a5e3111c39e6cc5e705e928db8738b9 Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Wed, 24 May 2017 00:04:19 +0200 Subject: [PATCH] GSdx GSLocalMemory: Reserve space required in the std::vector before adding elements to it. --- plugins/GSdx/GSLocalMemory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index 68d5bb98c8..85ff645259 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -699,6 +699,9 @@ vector* 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::iterator j = m.begin(); j != m.end(); ++j)