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

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

Issue 2614123002: Use StringView for String and AtomicString operator==. (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/wtf/text/AtomicString.h
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h
index ea3ee3c4b6f56af4db9698f5d5e7e165c2b4dd04..9a15200575ada8f621457fc62003ee7ad239df6e 100644
--- a/third_party/WebKit/Source/wtf/text/AtomicString.h
+++ b/third_party/WebKit/Source/wtf/text/AtomicString.h
@@ -232,54 +232,34 @@ class WTF_EXPORT AtomicString {
inline bool operator==(const AtomicString& a, const AtomicString& b) {
return a.impl() == b.impl();
}
-WTF_EXPORT bool operator==(const AtomicString&, const LChar*);
-inline bool operator==(const AtomicString& a, const char* b) {
- return WTF::equal(a.impl(), reinterpret_cast<const LChar*>(b));
-}
-inline bool operator==(const AtomicString& a, const Vector<UChar>& b) {
- return a.impl() && equal(a.impl(), b.data(), b.size());
-}
inline bool operator==(const AtomicString& a, const String& b) {
+ // We don't use equalStringView so we get the isAtomic() optimization inside
+ // WTF::equal.
return equal(a.impl(), b.impl());
}
-inline bool operator==(const LChar* a, const AtomicString& b) {
- return b == a;
-}
-inline bool operator==(const char* a, const AtomicString& b) {
+inline bool operator==(const String& a, const AtomicString& b) {
return b == a;
}
-inline bool operator==(const String& a, const AtomicString& b) {
- return equal(a.impl(), b.impl());
+inline bool operator==(const AtomicString& a, const char* b) {
+ return equalStringView(a, b);
}
-inline bool operator==(const Vector<UChar>& a, const AtomicString& b) {
+inline bool operator==(const char* a, const AtomicString& b) {
return b == a;
}
inline bool operator!=(const AtomicString& a, const AtomicString& b) {
return a.impl() != b.impl();
}
-inline bool operator!=(const AtomicString& a, const LChar* b) {
+inline bool operator!=(const AtomicString& a, const String& b) {
return !(a == b);
}
-inline bool operator!=(const AtomicString& a, const char* b) {
+inline bool operator!=(const String& a, const AtomicString& b) {
return !(a == b);
}
-inline bool operator!=(const AtomicString& a, const String& b) {
- return !equal(a.impl(), b.impl());
-}
-inline bool operator!=(const AtomicString& a, const Vector<UChar>& b) {
+inline bool operator!=(const AtomicString& a, const char* b) {
return !(a == b);
}
-inline bool operator!=(const LChar* a, const AtomicString& b) {
- return !(b == a);
-}
inline bool operator!=(const char* a, const AtomicString& b) {
- return !(b == a);
-}
-inline bool operator!=(const String& a, const AtomicString& b) {
- return !equal(a.impl(), b.impl());
-}
-inline bool operator!=(const Vector<UChar>& a, const AtomicString& b) {
return !(a == b);
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698