Skip to content

Commit b01289f

Browse files
committed
Set size of vector before adding items.
1 parent bbd3922 commit b01289f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/RhythmGameUtilities/Utilities.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ inline auto GenerateAdjacentKeyPairs(const std::map<int, int> &keyValuePairs)
101101

102102
std::vector<int> keys;
103103

104+
keys.reserve(keyValuePairs.size());
105+
104106
for (auto item : keyValuePairs)
105107
{
106108
keys.push_back(item.first);

0 commit comments

Comments
 (0)