Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp

Issue 2235113002: Use StringView for String::append and ::insert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix appendHex stuff. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
index 64b5fe37b6e6e71330f99841b81503b55e02440c..26bba4bd95f252fb57b38f492bb37970f8b64751 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -558,7 +558,7 @@ CSSPrimitiveValue::UnitType CSSPrimitiveValue::lengthUnitTypeToUnitType(LengthUn
return CSSPrimitiveValue::UnitType::Unknown;
}
-static String formatNumber(double number, const char* suffix, unsigned suffixLength)
+static String formatNumber(double number, const StringView& suffix)
{
#if OS(WIN) && _MSC_VER < 1900
unsigned oldFormat = _set_output_format(_TWO_DIGIT_EXPONENT);
@@ -567,21 +567,10 @@ static String formatNumber(double number, const char* suffix, unsigned suffixLen
#if OS(WIN) && _MSC_VER < 1900
_set_output_format(oldFormat);
#endif
- result.append(suffix, suffixLength);
+ result.append(suffix);
return result;
}
-template <unsigned characterCount>
-ALWAYS_INLINE static String formatNumber(double number, const char (&characters)[characterCount])
-{
- return formatNumber(number, characters, characterCount - 1);
-}
-
-static String formatNumber(double number, const char* characters)
-{
- return formatNumber(number, characters, strlen(characters));
-}
-
const char* CSSPrimitiveValue::unitTypeToString(UnitType type)
{
switch (type) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698