File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,8 @@ class Grouping
248248 const_cast <entry_index_t &>(m_endUserEntry) = getCountArticles ();
249249 }
250250
251- // Following code will may create cluster and
251+ // Following code will may create cluster and we want to remove them from cache
252+ // if something goes wrong.
252253 try {
253254 auto result = tmpDirentLookup.find (' X' , " listing/titleOrdered/v1" );
254255 if (result.first ) {
@@ -268,17 +269,16 @@ class Grouping
268269
269270 readMimeTypes ();
270271 } catch (...) {
271- dropCachedCluster ();
272+ dropCachedClusters ();
272273 throw ;
273274 }
274275 }
275276
276277 FileImpl::~FileImpl () {
277- // We have to clean the global cache for our clusters.
278- dropCachedCluster ();
278+ dropCachedClusters ();
279279 }
280280
281- void FileImpl::dropCachedCluster () const {
281+ void FileImpl::dropCachedClusters () const {
282282 getClusterCache ().dropAll ([=](const std::tuple<FileImpl*, cluster_index_type>& key) {return std::get<0 >(key) == this ;});
283283 }
284284
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ namespace zim
166166 explicit FileImpl (std::shared_ptr<FileCompound> zimFile);
167167 FileImpl (std::shared_ptr<FileCompound> zimFile, offset_t offset, zsize_t size);
168168
169- void dropCachedCluster () const ;
169+ void dropCachedClusters () const ;
170170
171171 std::unique_ptr<IndirectDirentAccessor> getTitleAccessorV1 (const entry_index_t idx);
172172 std::unique_ptr<IndirectDirentAccessor> getTitleAccessor (const offset_t offset, const zsize_t size, const std::string& name);
You can’t perform that action at this time.
0 commit comments