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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('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 0e02b8902dc3e5af8785a9aef81aedd68d50f3db..f2efeb157d943d89c89373fdc3b993e65836009f 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -442,52 +442,26 @@ class WTF_EXPORT String {
#undef DISPATCH_CASE_OP
inline bool operator==(const String& a, const String& b) {
+ // We don't use equalStringView here since we want the isAtomic() fast path
+ // inside WTF::equal.
return equal(a.impl(), b.impl());
}
-inline bool operator==(const String& a, const LChar* b) {
- return equal(a.impl(), b);
-}
inline bool operator==(const String& a, const char* b) {
- return equal(a.impl(), reinterpret_cast<const LChar*>(b));
-}
-inline bool operator==(const LChar* a, const String& b) {
- return equal(a, b.impl());
+ return equalStringView(a, b);
}
inline bool operator==(const char* a, const String& b) {
- return equal(reinterpret_cast<const LChar*>(a), b.impl());
-}
-template <size_t inlineCapacity>
-inline bool operator==(const Vector<char, inlineCapacity>& a, const String& b) {
- return equal(b.impl(), a.data(), a.size());
-}
-template <size_t inlineCapacity>
-inline bool operator==(const String& a, const Vector<char, inlineCapacity>& b) {
return b == a;
}
inline bool operator!=(const String& a, const String& b) {
- return !equal(a.impl(), b.impl());
-}
-inline bool operator!=(const String& a, const LChar* b) {
- return !equal(a.impl(), b);
+ return !(a == b);
}
inline bool operator!=(const String& a, const char* b) {
- return !equal(a.impl(), reinterpret_cast<const LChar*>(b));
-}
-inline bool operator!=(const LChar* a, const String& b) {
- return !equal(a, b.impl());
+ return !(a == b);
}
inline bool operator!=(const char* a, const String& b) {
- return !equal(reinterpret_cast<const LChar*>(a), b.impl());
-}
-template <size_t inlineCapacity>
-inline bool operator!=(const Vector<char, inlineCapacity>& a, const String& b) {
return !(a == b);
}
-template <size_t inlineCapacity>
-inline bool operator!=(const String& a, const Vector<char, inlineCapacity>& b) {
- return b != a;
-}
inline bool equalPossiblyIgnoringCase(const String& a,
const String& b,
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698