Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-60395

QHash, QMultiHash operator== is broken

XMLWordPrintable

    • dbd55cdaf367bdc9d6774bcb9927cbe19f18065f 4084f96052ea1568c847f8cfb52b6ae6d205ec4d

      This code

      #include <QtCore>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QHash<int, int> h1, h2;
          h1.insertMulti(0, 0);
          h1.insertMulti(0, 1);
      
          h2.insertMulti(0, 1);
          h2.insertMulti(0, 0);
      
          Q_ASSERT(h1 == h2);
      }
      

      asserts. Same with QMap and the Multi variants. A quick peek at the operator== shows that they're completely wrong for the multikey case.

        For Gerrit Dashboard: QTBUG-60395
        # Subject Branch Project Status CR V

            peppe Giuseppe D'Angelo
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes