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

[REG 6.7 -> 6.8] QSet::unite() no longer consistently picks equivalent elements from `other`

    XMLWordPrintable

Details

    • 2
    • 0d4fd5c54 (dev), 2d1b30286 (dev), 68cac07d5 (dev), 3dff1a3f7 (6.9), 12f39bb2a (6.9), 0e17856f6 (6.8), 88d9371d2 (6.8), 03f6f176b (dev), c52fc83d9 (tqtc/lts-6.5), 40434eec8 (tqtc/lts-6.2), 84cbcf52c (tqtc/lts-5.15)
    • Foundation Sprint 122, Foundation Sprint 123, Foundation Sprint 124

    Description

      https://doc.qt.io/qt-6/qset.html#unite says:

      Each item in the other set that isn't already in this set is inserted into this set.

      This is not what the implementation does:

          for (const auto &e : std::as_const(other))
              insert(e);
      

      (Created QTBUG-132503 to deal with this).

      Since https://codereview.qt-project.org/c/qt/qtbase/+/531872, which set is *this and which is other is now "random", a regression from 6.7.

      By Hyrum's Law, users may have some to expect that unite() works as implemented, meaning that equivalent elements of other overwrite elements of *this. Restore the old behavior.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: