diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-11 17:27:52 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-28 05:58:52 +0200 |
commit | 9a55c695c7ecb8a2154661462255423a20ef4097 (patch) | |
tree | f9b07d22115cf9f4984086a4aaa7c5dfea7e0c34 /src/gui/rhi/qshaderdescription.cpp | |
parent | 7b6b133746aa8bf23e08753851d7e23cc9d76170 (diff) |
QtGui: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui/rhi/qshaderdescription.cpp')
-rw-r--r-- | src/gui/rhi/qshaderdescription.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/rhi/qshaderdescription.cpp b/src/gui/rhi/qshaderdescription.cpp index 6bf6187b7f..5cb7b248bc 100644 --- a/src/gui/rhi/qshaderdescription.cpp +++ b/src/gui/rhi/qshaderdescription.cpp @@ -643,13 +643,13 @@ static const struct TypeTab { { "imageBuffer", QShaderDescription::ImageBuffer } }; -static QLatin1String typeStr(const QShaderDescription::VariableType &t) +static QLatin1StringView typeStr(const QShaderDescription::VariableType &t) { for (size_t i = 0; i < sizeof(typeTab) / sizeof(TypeTab); ++i) { if (typeTab[i].v == t) - return QLatin1String(typeTab[i].k); + return QLatin1StringView(typeTab[i].k); } - return QLatin1String(); + return {}; } static const struct ImageFormatTab { @@ -698,13 +698,13 @@ static const struct ImageFormatTab { { "r8ui", QShaderDescription::ImageFormatR8ui } }; -static QLatin1String imageFormatStr(const QShaderDescription::ImageFormat &f) +static QLatin1StringView imageFormatStr(const QShaderDescription::ImageFormat &f) { for (size_t i = 0; i < sizeof(imageFormatTab) / sizeof(ImageFormatTab); ++i) { if (imageFormatTab[i].v == f) - return QLatin1String(imageFormatTab[i].k); + return QLatin1StringView(imageFormatTab[i].k); } - return QLatin1String(); + return {}; } #ifndef QT_NO_DEBUG_STREAM @@ -806,7 +806,7 @@ QDebug operator<<(QDebug dbg, const QShaderDescription::StorageBlock &blk) } #endif -#define JSON_KEY(key) static constexpr QLatin1String key ## Key() noexcept { return QLatin1String( #key ); } +#define JSON_KEY(key) static constexpr QLatin1StringView key ## Key() noexcept { return QLatin1StringView( #key ); } JSON_KEY(name) JSON_KEY(type) JSON_KEY(location) |