Commit 7da1cfb0 authored by Eugene Kosov's avatar Eugene Kosov

avoid searching std::map twice in innochecksum

parent 1918bdf3
...@@ -912,12 +912,7 @@ parse_page( ...@@ -912,12 +912,7 @@ parse_page(
} }
/* update per-index statistics */ /* update per-index statistics */
{ {
if (index_ids.count(id) == 0) { per_index_stats &index = index_ids[id];
index_ids[id] = per_index_stats();
}
std::map<unsigned long long, per_index_stats>::iterator it;
it = index_ids.find(id);
per_index_stats &index = (it->second);
if (page_is_free(xdes, page_size, page_no)) { if (page_is_free(xdes, page_size, page_no)) {
index.free_pages++; index.free_pages++;
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment