mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-24 06:18:25 +00:00
Remove unnecessary string copies
Found via clang-tidy.
This commit is contained in:
parent
fada95f58e
commit
61ecafd426
@ -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…
x
Reference in New Issue
Block a user