Id: Remove redundant const modifiers from by-value arguments

Change-Id: I2f66822b8b8076ed2eb13729bd466e9e2204bccb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2024-11-03 10:05:28 +02:00
committed by Orgad Shaneh
parent dd1cbd6ac2
commit 6384ce6d4a
2 changed files with 8 additions and 8 deletions

View File

@@ -183,7 +183,7 @@ Key Id::toKey() const
\sa toString(), fromSetting() \sa toString(), fromSetting()
*/ */
Id Id::fromString(const QStringView name) Id Id::fromString(QStringView name)
{ {
if (name.isEmpty()) if (name.isEmpty())
return Id(); return Id();
@@ -202,7 +202,7 @@ Id Id::fromString(const QStringView name)
\sa toString(), fromSetting() \sa toString(), fromSetting()
*/ */
Id Id::fromName(const QByteArrayView name) Id Id::fromName(QByteArrayView name)
{ {
return Id(theId(name.data(), name.size())); return Id(theId(name.data(), name.size()));
} }
@@ -273,7 +273,7 @@ Id Id::withSuffix(int suffix) const
/*! /*!
\overload \overload
*/ */
Id Id::withSuffix(const char suffix) const Id Id::withSuffix(char suffix) const
{ {
const QByteArray ba = name() + suffix; const QByteArray ba = name() + suffix;
return Id(theId(ba.data(), ba.size())); return Id(theId(ba.data(), ba.size()));
@@ -293,7 +293,7 @@ Id Id::withSuffix(const char *suffix) const
\overload \overload
*/ */
Id Id::withSuffix(const QStringView suffix) const Id Id::withSuffix(QStringView suffix) const
{ {
const QByteArray ba = name() + suffix.toUtf8(); const QByteArray ba = name() + suffix.toUtf8();
return Id(theId(ba.data(), ba.size())); return Id(theId(ba.data(), ba.size()));

View File

@@ -34,9 +34,9 @@ public:
#if QT_POINTER_SIZE != 4 #if QT_POINTER_SIZE != 4
Id withSuffix(int suffix) const; Id withSuffix(int suffix) const;
#endif #endif
Id withSuffix(const char suffix) const; Id withSuffix(char suffix) const;
Id withSuffix(const char *suffix) const; Id withSuffix(const char *suffix) const;
Id withSuffix(const QStringView suffix) const; Id withSuffix(QStringView suffix) const;
Id withPrefix(const char *prefix) const; Id withPrefix(const char *prefix) const;
QByteArrayView name() const; QByteArrayView name() const;
@@ -54,8 +54,8 @@ public:
bool operator>(Id id) const { return m_id > id.m_id; } bool operator>(Id id) const { return m_id > id.m_id; }
bool alphabeticallyBefore(Id other) const; bool alphabeticallyBefore(Id other) const;
static Id fromString(const QStringView str); // FIXME: avoid. static Id fromString(QStringView str); // FIXME: avoid.
static Id fromName(const QByteArrayView ba); // FIXME: avoid. static Id fromName(QByteArrayView ba); // FIXME: avoid.
static Id fromSetting(const QVariant &variant); // Good to use. static Id fromSetting(const QVariant &variant); // Good to use.
static QSet<Id> fromStringList(const QStringList &list); static QSet<Id> fromStringList(const QStringList &list);