mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-10 23:00:57 +00:00
Merge pull request #920 from gaul/clang-tidy/string-copy
Remove unnecessary string copies
This commit is contained in:
commit
f219817eb3
@ -4261,7 +4261,7 @@ string get_canonical_headers(const struct curl_slist* list)
|
||||
// skip empty-value headers (as they are discarded by libcurl)
|
||||
continue;
|
||||
}
|
||||
strhead = strkey + string(":") + strval;
|
||||
strhead = strkey.append(":").append(strval);
|
||||
}else{
|
||||
strhead = trim(lower(strhead));
|
||||
}
|
||||
@ -4290,7 +4290,7 @@ string get_canonical_headers(const struct curl_slist* list, bool only_amz)
|
||||
// skip empty-value headers (as they are discarded by libcurl)
|
||||
continue;
|
||||
}
|
||||
strhead = strkey + string(":") + strval;
|
||||
strhead = strkey.append(":").append(strval);
|
||||
}else{
|
||||
strhead = trim(lower(strhead));
|
||||
}
|
||||
|
@ -120,8 +120,7 @@ string trim_right(const string &s, const string &t /* = SPACES */)
|
||||
|
||||
string trim(const string &s, const string &t /* = SPACES */)
|
||||
{
|
||||
string d(s);
|
||||
return trim_left(trim_right(d, t), t);
|
||||
return trim_left(trim_right(s, t), t);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user