Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
13
-
26fec96a8 (dev)
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
- is cloned by
-
QTBUG-106183 QByteArray: don't detach in remove()/removeIf()/erase()
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-106181 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
440068,10 | QString: don't detach in remove(pos, len) | dev | qt/qtbase | Status: MERGED | +2 | 0 |
440070,4 | QString: don't detach in remove(QChar ch, Qt::CaseSensitivity cs) | dev | qt/qtbase | Status: MERGED | +2 | 0 |
442542,7 | QString: don't detach in removeStringImpl() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
443125,4 | Sequential containers, don't detach in removeIf()/erase_if() | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |
444263,23 | QString, QByteArray: don't detach in removeIf/erase/eraseif() | dev | qt/qtbase | Status: ABANDONED | +2 | 0 |
452556,22 | QString, QByteArray: don't detach in removeIf/erase/eraseif() | dev | qt/qtbase | Status: MERGED | +2 | 0 |