diff options
author | hjk <[email protected]> | 2024-07-25 17:09:51 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2024-09-02 11:12:41 +0000 |
commit | 010eb642df53464f5ee0997b63af62478daca9f4 (patch) | |
tree | 279fc3997aef2464c7862b191a26ffc1f7049505 /src/libs/utils/id.h | |
parent | e148be365ee83b69205808ea92084ff49af9845e (diff) |
Utils: Make Id::name() return a QByteArrayView
As we keep all id name content in IdCache which stays until
application shutdown this is as safe as returning a full
QByteArray, but cheaper.
Change-Id: Ic41feb0a648d1267bbfb57a6a18a724a0ab52d80
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/libs/utils/id.h')
-rw-r--r-- | src/libs/utils/id.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/utils/id.h b/src/libs/utils/id.h index e8a150a49fa..9e80af45352 100644 --- a/src/libs/utils/id.h +++ b/src/libs/utils/id.h @@ -34,7 +34,8 @@ public: Id withSuffix(const QStringView suffix) const; Id withPrefix(const char *prefix) const; - QByteArray name() const; + QByteArrayView name() const; + QByteArray toByteArray() const; // Avoid QString toString() const; // Avoid. Key toKey() const; // FIXME: Replace uses with .name() after Store/key transition. QVariant toSetting() const; // Good to use. |