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

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

Issue 587173005: Add WTF::String::emptyString16Bit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« Source/wtf/text/WTFString.h ('K') | « Source/wtf/text/WTFString.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/WTFString.cpp
diff --git a/Source/wtf/text/WTFString.cpp b/Source/wtf/text/WTFString.cpp
index d72969f19a6a82d4f4f9e513510ec2b01ad2749f..4059412a0d46cbad2741b7381cccfd498b6dd524 100644
--- a/Source/wtf/text/WTFString.cpp
+++ b/Source/wtf/text/WTFString.cpp
@@ -887,7 +887,7 @@ String String::make8BitFrom16BitSource(const UChar* source, size_t length)
String String::make16BitFrom8BitSource(const LChar* source, size_t length)
{
if (!length)
- return emptyString();
+ return emptyString(Force16BitEmpty);
UChar* destination;
String result = String::createUninitialized(length, destination);
@@ -1226,6 +1226,12 @@ const String& emptyString()
return emptyString;
}
+const String& emptyString(Force16Bit)
+{
+ DEFINE_STATIC_LOCAL(String, emptyString, (StringImpl::empty(StringImpl::Force16BitEmpty)));
+ return emptyString;
+}
+
} // namespace WTF
#ifndef NDEBUG
« Source/wtf/text/WTFString.h ('K') | « Source/wtf/text/WTFString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698