mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-15 16:57:10 +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)
|
// skip empty-value headers (as they are discarded by libcurl)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strhead = strkey + string(":") + strval;
|
strhead = strkey.append(":").append(strval);
|
||||||
}else{
|
}else{
|
||||||
strhead = trim(lower(strhead));
|
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)
|
// skip empty-value headers (as they are discarded by libcurl)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strhead = strkey + string(":") + strval;
|
strhead = strkey.append(":").append(strval);
|
||||||
}else{
|
}else{
|
||||||
strhead = trim(lower(strhead));
|
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 trim(const string &s, const string &t /* = SPACES */)
|
||||||
{
|
{
|
||||||
string d(s);
|
return trim_left(trim_right(s, t), t);
|
||||||
return trim_left(trim_right(d, t), t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user