mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-18 10:15:13 +00:00
Use C++11 std::map::erase return value (#2236)
This commit is contained in:
parent
38a1ff42e5
commit
36db898d01
@ -546,7 +546,7 @@ bool StatCache::TruncateCache()
|
||||
stat_cache_entry* entry = iter->second;
|
||||
if(!entry || (0L == entry->notruncate && IsExpireStatCacheTime(entry->cache_date, ExpireTime))){
|
||||
delete entry;
|
||||
stat_cache.erase(iter++);
|
||||
iter = stat_cache.erase(iter);
|
||||
}else{
|
||||
++iter;
|
||||
}
|
||||
@ -718,7 +718,7 @@ bool StatCache::TruncateSymlink()
|
||||
symlink_cache_entry* entry = iter->second;
|
||||
if(!entry || IsExpireStatCacheTime(entry->cache_date, ExpireTime)){ // use the same as Stats
|
||||
delete entry;
|
||||
symlink_cache.erase(iter++);
|
||||
iter = symlink_cache.erase(iter);
|
||||
}else{
|
||||
++iter;
|
||||
}
|
||||
|
@ -730,12 +730,12 @@ bool FdManager::Close(FdEntity* ent, int fd)
|
||||
ent->Close(fd);
|
||||
if(!ent->IsOpen()){
|
||||
// remove found entity from map.
|
||||
fent.erase(iter++);
|
||||
iter = fent.erase(iter);
|
||||
|
||||
// check another key name for entity value to be on the safe side
|
||||
for(; iter != fent.end(); ){
|
||||
if(iter->second == ent){
|
||||
fent.erase(iter++);
|
||||
iter = fent.erase(iter);
|
||||
}else{
|
||||
++iter;
|
||||
}
|
||||
@ -754,7 +754,7 @@ bool FdManager::ChangeEntityToTempPath(FdEntity* ent, const char* path)
|
||||
|
||||
for(fdent_map_t::iterator iter = fent.begin(); iter != fent.end(); ){
|
||||
if(iter->second == ent){
|
||||
fent.erase(iter++);
|
||||
iter = fent.erase(iter);
|
||||
|
||||
std::string tmppath;
|
||||
FdManager::MakeRandomTempPath(path, tmppath);
|
||||
|
@ -2378,7 +2378,7 @@ bool FdEntity::MergeOrgMeta(headers_t& updatemeta)
|
||||
// this is special cases, we remove the key which has empty values.
|
||||
for(headers_t::iterator hiter = orgmeta.begin(); hiter != orgmeta.end(); ){
|
||||
if(hiter->second.empty()){
|
||||
orgmeta.erase(hiter++);
|
||||
hiter = orgmeta.erase(hiter);
|
||||
}else{
|
||||
++hiter;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user