Skip to content

Commit

Permalink
Revert "Preallocate memory for image/file presence caches"
Browse files Browse the repository at this point in the history
This reverts commit a3ef808.

Vector reallocation cost is logarithmic. Assuming that a vector
starts at a size of one and doubles its size in each allocation, the
result is 11 allocations - completely negligible compared with, you
know, loading 20 000 images from disk.
  • Loading branch information
jyrkive committed May 21, 2018
1 parent 949266b commit 1066de1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/image.cpp
Expand Up @@ -108,7 +108,6 @@ class cache_type
cache_type()
: content_()
{
content_.reserve(20000);
}

cache_item<T>& get_element(int index)
Expand Down

0 comments on commit 1066de1

Please sign in to comment.