forked from OSchip/llvm-project
unique_ptr-ify FileSystemStatCache::takeNextStatCache
llvm-svn: 215318
This commit is contained in:
parent
2721c32e47
commit
dd0e1e8d14
|
@ -84,7 +84,9 @@ public:
|
|||
/// \brief Retrieve the next stat call cache in the chain, transferring
|
||||
/// ownership of this cache (and, transitively, all of the remaining caches)
|
||||
/// to the caller.
|
||||
FileSystemStatCache *takeNextStatCache() { return NextStatCache.release(); }
|
||||
std::unique_ptr<FileSystemStatCache> takeNextStatCache() {
|
||||
return std::move(NextStatCache);
|
||||
}
|
||||
|
||||
protected:
|
||||
// FIXME: The pointer here is a non-owning/optional reference to the
|
||||
|
|
|
@ -86,7 +86,7 @@ void FileManager::removeStatCache(FileSystemStatCache *statCache) {
|
|||
|
||||
if (StatCache.get() == statCache) {
|
||||
// This is the first stat cache.
|
||||
StatCache.reset(StatCache->takeNextStatCache());
|
||||
StatCache = StatCache->takeNextStatCache();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue