From a553d5baac29f18092382fe8a905805976043783 Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Mon, 21 May 2018 16:29:30 +0300 Subject: [PATCH] Revert "Preallocate memory for image/file presence caches" This reverts commit a3ef80853caac8fd1c115418b2474af07dd1cb14. 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. (cherry-picked from commit 1066de1a827338840cfe44a32824e6d1a2e9207f) --- src/image.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/image.cpp b/src/image.cpp index 5c1160dfd465..1acbd59c8396 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -106,7 +106,6 @@ class cache_type cache_type() : content_() { - content_.reserve(20000); } cache_item& get_element(int index)