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

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

Issue 2585063002: Cache contains only ascii in StringImpl (Closed)
Patch Set: cache contains only ascci Created 4 years 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/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 7460ac18cfe83a0f960a9c98ada72ba51fb29ae9..0f61a94e18b30d4f7035dcd8fa59cedd5b0319d7 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -408,7 +408,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();
@@ -556,16 +558,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) {

Powered by Google App Engine
This is Rietveld 408576698