fix unique_ptr

This commit is contained in:
KinderRiven 2022-08-10 23:19:26 +08:00
parent 9b7f87677d
commit 1aa7bbcbbd
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class IFileCachePriority
public: public:
class IIterator; class IIterator;
using Key = FileCacheKey; using Key = FileCacheKey;
using ReadIterator = std::shared_ptr<const IIterator>; using ReadIterator = std::unique_ptr<const IIterator>;
using WriteIterator = std::shared_ptr<IIterator>; using WriteIterator = std::shared_ptr<IIterator>;
struct FileCacheRecord struct FileCacheRecord

View File

@ -45,7 +45,7 @@ void LRUFileCachePriority::removeAll(std::lock_guard<std::mutex> &)
IFileCachePriority::ReadIterator LRUFileCachePriority::getLowestPriorityReadIterator(std::lock_guard<std::mutex> &) IFileCachePriority::ReadIterator LRUFileCachePriority::getLowestPriorityReadIterator(std::lock_guard<std::mutex> &)
{ {
return std::make_shared<const LRUFileCacheIterator>(this, queue.begin()); return std::make_unique<const LRUFileCacheIterator>(this, queue.begin());
} }
IFileCachePriority::WriteIterator LRUFileCachePriority::getLowestPriorityWriteIterator(std::lock_guard<std::mutex> &) IFileCachePriority::WriteIterator LRUFileCachePriority::getLowestPriorityWriteIterator(std::lock_guard<std::mutex> &)