mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-11-26 10:13:50 +08:00
policy_cache.hpp
This commit is contained in:
parent
b98a8689f3
commit
a2e7a4d040
|
@ -38,13 +38,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void
|
const
|
||||||
|
std::string*
|
||||||
insert(std::string const &key_,
|
insert(std::string const &key_,
|
||||||
std::string &val_)
|
std::string &val_)
|
||||||
{
|
{
|
||||||
if(_cache.size() > _max_size)
|
if(_cache.size() > _max_size)
|
||||||
_cache.erase(_cache.begin());
|
_cache.erase(_cache.begin());
|
||||||
_cache.insert({key_,val_});
|
return &_cache.insert({key_,val_}).first;
|
||||||
}
|
}
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
Loading…
Reference in New Issue
Block a user