mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-03 05:00:15 +00:00
Look up header values directly (#2592)
stat_cache_entry::meta uses a case-insensitive comparator so there is no need to loop over each entry to compare each key with lowercase.
This commit is contained in:
parent
7a989a58a0
commit
d9ccdc4fce
@ -223,15 +223,12 @@ bool StatCache::GetStat(const std::string& key, struct stat* pst, headers_t* met
|
||||
std::string stretag;
|
||||
if(petag){
|
||||
// find & check ETag
|
||||
for(auto hiter = ent->meta.cbegin(); hiter != ent->meta.cend(); ++hiter){
|
||||
std::string tag = lower(hiter->first);
|
||||
if(tag == "etag"){
|
||||
auto hiter = ent->meta.find("etag");
|
||||
if(hiter != ent->meta.end()){
|
||||
stretag = hiter->second;
|
||||
if('\0' != petag[0] && petag != stretag){
|
||||
is_delete_cache = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(is_delete_cache){
|
||||
|
Loading…
Reference in New Issue
Block a user