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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 2585063002: Cache contains only ascii in StringImpl (Closed)
Patch Set: DCHECK + static_Cast Created 3 years, 11 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 | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index d0382a01426a3d036922e3de9007f1b03c5e6b0a..162d94bbc0eabd63540a7c7f860c83564e389cfc 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -405,7 +405,9 @@ class WTF_EXPORT String {
length);
}
- bool containsOnlyASCII() const;
+ bool containsOnlyASCII() const {
+ return !m_impl || m_impl->containsOnlyASCII();
+ }
bool containsOnlyLatin1() const;
bool containsOnlyWhitespace() const {
return !m_impl || m_impl->containsOnlyWhitespace();
@@ -553,16 +555,6 @@ inline NSString* nsStringNilIfEmpty(const String& str) {
}
#endif
-inline bool String::containsOnlyASCII() const {
- if (isEmpty())
- return true;
-
- if (is8Bit())
- return charactersAreAllASCII(characters8(), m_impl->length());
-
- return charactersAreAllASCII(characters16(), m_impl->length());
-}
-
WTF_EXPORT int codePointCompare(const String&, const String&);
inline bool codePointCompareLessThan(const String& a, const String& b) {
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698