Vector<T>::operator== shouldn't require T to have operator!=
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 18:06:23 +0000 (18:06 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 18:06:23 +0000 (18:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77448

Reviewed by Andreas Kling.

Change VectorComparer::compare to use !(a == b) instead of a != b since
it makes more sense for Vector::operator== to use the element's operator==.

* wtf/Vector.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/Vector.h

index a3ecffb..0aa969f 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-31  Anders Carlsson  <andersca@apple.com>
+
+        Vector<T>::operator== shouldn't require T to have operator!=
+        https://bugs.webkit.org/show_bug.cgi?id=77448
+
+        Reviewed by Andreas Kling.
+
+        Change VectorComparer::compare to use !(a == b) instead of a != b since
+        it makes more sense for Vector::operator== to use the element's operator==.
+
+        * wtf/Vector.h:
+
 2012-01-30  Oliver Hunt  <oliver@apple.com>
 
         get_by_val_arguments is broken in the interpreter
index 1368ac9..175f1a5 100644 (file)
@@ -194,7 +194,7 @@ namespace WTF {
         static bool compare(const T* a, const T* b, size_t size)
         {
             for (size_t i = 0; i < size; ++i)
-                if (a[i] != b[i])
+                if (!(a[i] == b[i]))
                     return false;
             return true;
         }