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

Unified Diff: Source/wtf/text/StringBuilder.cpp

Issue 212603003: De-bloat SVGPathStringBuilder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/wtf/text/StringBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringBuilder.cpp
diff --git a/Source/wtf/text/StringBuilder.cpp b/Source/wtf/text/StringBuilder.cpp
index 8f3c522bdfdb4b400974d96f1e27837074dd668a..5dd8cab51cd1ef02a68b35d257416ef6b0b5610c 100644
--- a/Source/wtf/text/StringBuilder.cpp
+++ b/Source/wtf/text/StringBuilder.cpp
@@ -29,6 +29,7 @@
#include "IntegerToStringConversion.h"
#include "WTFString.h"
+#include "wtf/dtoa.h"
namespace WTF {
@@ -346,6 +347,12 @@ void StringBuilder::appendNumber(unsigned long long number)
numberToStringUnsigned<StringBuilder>(number, this);
}
+void StringBuilder::appendNumber(double number, unsigned precision, TrailingZerosTruncatingPolicy trailingZerosTruncatingPolicy)
+{
+ NumberToStringBuffer buffer;
+ append(numberToFixedPrecisionString(number, precision, buffer, trailingZerosTruncatingPolicy == TruncateTrailingZeros));
abarth-chromium 2014/03/26 16:52:31 This can be made more efficient. You're creating
+}
+
bool StringBuilder::canShrink() const
{
// Only shrink the buffer if it's less than 80% full. Need to tune this heuristic!
« no previous file with comments | « Source/wtf/text/StringBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698