Skip to content

Commit d00e5ce

Browse files
more fix up for ISystem::future_t
1 parent 94dbca2 commit d00e5ce

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

include/nbl/asset/utils/CDirQuantCacheBase.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff 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
//!

0 commit comments

Comments
 (0)