Skip to content

core: use CowByteArray everywhere possible - #48464

Merged
jkarneges merged 1 commit into
mainfrom
jkarneges/core-cowbytearray
Oct 28, 2026
Merged

jkarneges merged 1 commit into
mainfrom
jkarneges/core-cowbytearray

Conversation

@jkarneges

@jkarneges jkarneges commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Following #48459 which targeted headers, this PR replaces as many uses of QByteArray with CowByteArray as possible in the rest of the core module, without removing compatibility code.

With this, all use of QByteArray is eliminated from the core module except:

  • Where necessary to interoperate with other Qt APIs, e.g. calls to .asQByteArray(). These uses will go away as we migrate away from these other APIs.
  • Its use in the backing implementation of CowByteArray. This use will go away when it is the only usage remaining and we swap it out for a non-Qt implementation.
% rg --pcre2 -g 'src/core/*' -g '!cowbytearray*' -i '(?<!as)qbytearray'
src/core/qtcompat.h
41:    ByteArray = QMetaType::QByteArray,

src/core/cowurl.h
22:#include <QByteArrayView>
95:    return qHash(QByteArrayView(s.data, static_cast<qsizetype>(s.len)), seed);

src/core/statusreasons.cpp
39:    return CowByteArray(QByteArray::fromRawData(s, size));

@jkarneges
jkarneges force-pushed the jkarneges/core-cowbytearray branch from 571dfbb to 4d42f31 Compare October 28, 2026 17:07
@jkarneges
jkarneges requested a review from a team October 28, 2026 17:38
@jkarneges
jkarneges merged commit dab38fe into main Oct 28, 2026
21 checks passed
@jkarneges
jkarneges deleted the jkarneges/core-cowbytearray branch October 28, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants