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

Unified Diff: third_party/WebKit/Source/platform/graphics/Color.cpp

Issue 2100573002: Avoid copying strings when parsing CSS colors on the slow path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing else. Created 4 years, 6 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
Index: third_party/WebKit/Source/platform/graphics/Color.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp
index 39cfb207752d0d7e92121e34e654c88f9d839228..cc973b6447b1a5ca3d45bb8a9530db6827630bd9 100644
--- a/third_party/WebKit/Source/platform/graphics/Color.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
@@ -167,11 +167,9 @@ bool Color::parseHexColor(const UChar* name, unsigned length, RGBA32& rgb)
return parseHexColorInternal(name, length, rgb);
}
-bool Color::parseHexColor(const String& name, RGBA32& rgb)
+bool Color::parseHexColor(const StringView& name, RGBA32& rgb)
{
- unsigned length = name.length();
-
- if (!length)
+ if (name.isEmpty())
return false;
if (name.is8Bit())
return parseHexColor(name.characters8(), name.length(), rgb);

Powered by Google App Engine
This is Rietveld 408576698