File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -317,11 +317,9 @@ class CDirQuantCacheBase : public impl::CDirQuantCacheBase
317317 {
318318 system::ISystem::future_t <core::smart_refctd_ptr<system::IFile>> future;
319319 system->createFile (future,path,nbl::system::IFile::ECF_READ);
320- auto file = future.get ();
321- if (!file)
322- return false ;
323-
324- return loadCacheFromFile<CacheFormat>(file.get (),replaceCurrentContents);
320+ if (auto file=future.acquire ())
321+ return loadCacheFromFile<CacheFormat>(file->get (),replaceCurrentContents);
322+ return false ;
325323 }
326324
327325 // !
@@ -363,11 +361,9 @@ class CDirQuantCacheBase : public impl::CDirQuantCacheBase
363361 {
364362 system::ISystem::future_t <core::smart_refctd_ptr<system::IFile>> future;
365363 system->createFile (future, path, nbl::system::IFile::ECF_WRITE);
366- auto file = future.get ();
367- if (!file)
368- return false ;
369-
370- return bool (saveCacheToFile<CacheFormat>(file.get ()));
364+ if (auto file=future.acquire ())
365+ return bool (saveCacheToFile<CacheFormat>(file->get ()));
366+ return false ;
371367 }
372368
373369 // !
You can’t perform that action at this time.
0 commit comments