From 7c21c19d0f2cb73697bff28476808f3744b37782 Mon Sep 17 00:00:00 2001 From: "jbroman@chromium.org" Date: Tue, 9 Jun 2015 23:55:04 +0000 Subject: wtf: Add missing operator==(const char*, const AtomicString&). Because of this, the following (natural) statement would not compile in tests: ASSERT_EQ("expected", AtomicString("actual")); AtomicStringTest didn't catch this because it had the actual and expected values reversed in each case that used equality. Review URL: https://codereview.chromium.org/1175713002 git-svn-id: svn://svn.chromium.org/blink/trunk@196807 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- third_party/WebKit/Source/wtf/text/AtomicString.h | 2 ++ 1 file changed, 2 insertions(+) (limited to '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 aea437a..792344e 100644 --- a/third_party/WebKit/Source/wtf/text/AtomicString.h +++ b/third_party/WebKit/Source/wtf/text/AtomicString.h @@ -188,6 +188,7 @@ inline bool operator==(const AtomicString& a, const char* b) { return WTF::equal inline bool operator==(const AtomicString& a, const Vector& b) { return a.impl() && equal(a.impl(), b.data(), b.size()); } inline bool operator==(const AtomicString& a, const String& b) { 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) { return b == a; } inline bool operator==(const String& a, const AtomicString& b) { return equal(a.impl(), b.impl()); } inline bool operator==(const Vector& a, const AtomicString& b) { return b == a; } @@ -197,6 +198,7 @@ inline bool operator!=(const AtomicString& a, const char* 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& 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& a, const AtomicString& b) { return !(a == b); } -- cgit v1.1