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
317
317
{
318
318
system::ISystem::future_t <core::smart_refctd_ptr<system::IFile>> future;
319
319
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 ;
325
323
}
326
324
327
325
// !
@@ -363,11 +361,9 @@ class CDirQuantCacheBase : public impl::CDirQuantCacheBase
363
361
{
364
362
system::ISystem::future_t <core::smart_refctd_ptr<system::IFile>> future;
365
363
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 ;
371
367
}
372
368
373
369
// !
You can’t perform that action at this time.
0 commit comments