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

Unified Diff: Source/core/platform/graphics/Color.cpp

Issue 20002008: Don't use Vector<UChar> to build strings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix unit test Created 7 years, 5 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 | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/platform/text/LocaleICU.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/Color.cpp
diff --git a/Source/core/platform/graphics/Color.cpp b/Source/core/platform/graphics/Color.cpp
index 96aa93c896f6f618bf13fec113f55ebf42c6755b..f3bfb8cbcffb2981159882e2d700b6e8a4345e02 100644
--- a/Source/core/platform/graphics/Color.cpp
+++ b/Source/core/platform/graphics/Color.cpp
@@ -191,17 +191,17 @@ String Color::serialized() const
return builder.toString();
}
- Vector<LChar> result;
- result.reserveInitialCapacity(28);
+ StringBuilder result;
+ result.reserveCapacity(28);
const char commaSpace[] = ", ";
const char rgbaParen[] = "rgba(";
result.append(rgbaParen, 5);
- appendNumber(result, red());
+ result.appendNumber(red());
result.append(commaSpace, 2);
- appendNumber(result, green());
+ result.appendNumber(green());
result.append(commaSpace, 2);
- appendNumber(result, blue());
+ result.appendNumber(blue());
result.append(commaSpace, 2);
if (!alpha())
@@ -213,7 +213,7 @@ String Color::serialized() const
}
result.append(')');
- return String::adopt(result);
+ return result.toString();
}
String Color::nameForRenderTreeAsText() const
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/platform/text/LocaleICU.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698