Pass StringPiece(16)? by value in //base/strings
As recommended by string_piece.h this patch changes all the other
headers in //base/strings with methods that take a StringPiece or
StringPiece16 to receive it by value rather than const-reference.
Change-Id: Id87fb8481e136518029fabb82f5e5a1db19a2b9e
Reviewed-on: https://chromium-review.googlesource.com/848511
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Luke Z <[email protected]>
Reviewed-by: Ryo Hashimoto <[email protected]>
Commit-Queue: Reilly Grant <[email protected]>
Cr-Commit-Position: refs/heads/master@{#527440}
diff --git a/base/strings/sys_string_conversions_mac.mm b/base/strings/sys_string_conversions_mac.mm
index 32fe89c..637d941 100644
--- a/base/strings/sys_string_conversions_mac.mm
+++ b/base/strings/sys_string_conversions_mac.mm
@@ -131,7 +131,7 @@
}
// Do not assert in this function since it is used by the asssertion code!
-std::wstring SysUTF8ToWide(const StringPiece& utf8) {
+std::wstring SysUTF8ToWide(StringPiece utf8) {
return STLStringToSTLStringWithEncodingsT<StringPiece, std::wstring>(
utf8, kNarrowStringEncoding, kWideStringEncoding);
}
@@ -140,7 +140,7 @@
return SysWideToUTF8(wide);
}
-std::wstring SysNativeMBToWide(const StringPiece& native_mb) {
+std::wstring SysNativeMBToWide(StringPiece native_mb) {
return SysUTF8ToWide(native_mb);
}