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

QByteArray: don't detach in remove()/removeIf()/erase()

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      After we've detected that we need to change the container in remove()/erase(), don't detach(). Instead, check if we're shared. If we're not shared, do the change in-place. If we are shared, make a new container, copy only the subset that forms the final result over, then assign the new container to *this.

      See epic for more details.

      Acceptance criteria: The following member functions no longer detach:

      • chop()
      • clear()
      • erase() (all overloads, eventually, cf. QTBUG-106182)
      • fill()
      • pop_back()/pop_front()/removeFirst()/removeLast()
      • remove() (all overloads)/removeIf()
      • resize()
      • setNum() (all overloads)
      • truncate()
      • if QTBUG-106165 is implemented meanwhile: assign()

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              cnn Qt Core & Network
              Reporter:
              mmutz Marc Mutz
              PM Owner:
              Vladimir Minenko Vladimir Minenko
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change