File tree 2 files changed +3
-0
lines changed
2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ bool Database_Dummy::deleteBlock(const v3s16 &pos)
47
47
48
48
void Database_Dummy::listAllLoadableBlocks (std::vector<v3s16> &dst)
49
49
{
50
+ dst.reserve (m_database.size ());
50
51
for (std::map<s64, std::string>::const_iterator x = m_database.begin ();
51
52
x != m_database.end (); ++x) {
52
53
dst.push_back (getIntegerAsBlock (x->first ));
Original file line number Diff line number Diff line change @@ -169,10 +169,12 @@ void Database_Redis::listAllLoadableBlocks(std::vector<v3s16> &dst)
169
169
}
170
170
switch (reply->type ) {
171
171
case REDIS_REPLY_ARRAY:
172
+ dst.reserve (reply->elements );
172
173
for (size_t i = 0 ; i < reply->elements ; i++) {
173
174
assert (reply->element [i]->type == REDIS_REPLY_STRING);
174
175
dst.push_back (getIntegerAsBlock (stoi64 (reply->element [i]->str )));
175
176
}
177
+ break ;
176
178
case REDIS_REPLY_ERROR:
177
179
throw FileNotGoodException (std::string (
178
180
" Failed to get keys from database: " ) + reply->str );
You can’t perform that action at this time.
0 commit comments