Core/StringExt: Don't pass string_view by ref

https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/
This commit is contained in:
SirLynix
2023-08-24 08:23:14 +02:00
parent 1b7a89213d
commit bd53245f42
51 changed files with 115 additions and 115 deletions

View File

@@ -18,7 +18,7 @@ namespace Nz
DDSLoader() = delete;
~DDSLoader() = delete;
static bool IsSupported(const std::string_view& extension)
static bool IsSupported(std::string_view extension)
{
return (extension == ".dds");
}

View File

@@ -378,7 +378,7 @@ namespace Nz
mutable unsigned int m_characterSize;
};
bool IsFreetypeSupported(const std::string_view& extension)
bool IsFreetypeSupported(std::string_view extension)
{
constexpr auto s_supportedExtensions = frozen::make_unordered_set<frozen::string>({ ".afm", ".bdf", ".cff", ".cid", ".dfont", ".fnt", ".fon", ".otf", ".pfa", ".pfb", ".pfm", ".pfr", ".sfnt", ".ttc", ".tte", ".ttf" });

View File

@@ -704,7 +704,7 @@ namespace Nz
bool m_requiresFrameHistory;
};
bool CheckGIFExtension(const std::string_view& extension)
bool CheckGIFExtension(std::string_view extension)
{
return extension == ".gif";
}

View File

@@ -21,7 +21,7 @@ namespace Nz
{
namespace
{
bool IsMD2Supported(const std::string_view& extension)
bool IsMD2Supported(std::string_view extension)
{
return (extension == ".md2");
}

View File

@@ -12,7 +12,7 @@ namespace Nz
{
namespace
{
bool IsMD5AnimSupported(const std::string_view& extension)
bool IsMD5AnimSupported(std::string_view extension)
{
return extension == ".md5anim";
}

View File

@@ -20,7 +20,7 @@ namespace Nz
{
namespace
{
bool IsMD5MeshSupported(const std::string_view& extension)
bool IsMD5MeshSupported(std::string_view extension)
{
return (extension == ".md5mesh");
}

View File

@@ -22,7 +22,7 @@ namespace Nz
{
namespace
{
bool IsOBJSupported(const std::string_view& extension)
bool IsOBJSupported(std::string_view extension)
{
return (extension == ".obj");
}

View File

@@ -52,7 +52,7 @@ namespace Nz
T* m_buffer;
};
bool IsOBJSupportedSave(const std::string_view& extension)
bool IsOBJSupportedSave(std::string_view extension)
{
return (extension == ".obj");
}

View File

@@ -40,7 +40,7 @@ namespace Nz
static_assert(sizeof(PCXHeader) == (6+48+54)*sizeof(UInt8) + 10*sizeof(UInt16), "pcx_header struct must be packed");
bool IsPCXSupported(const std::string_view& extension)
bool IsPCXSupported(std::string_view extension)
{
return (extension == ".pcx");
}

View File

@@ -41,7 +41,7 @@ namespace Nz
static stbi_io_callbacks s_stbiCallbacks = { StbiRead, StbiSkip, StbiEof };
bool IsSTBSupported(const std::string_view& extension)
bool IsSTBSupported(std::string_view extension)
{
constexpr auto s_supportedExtensions = frozen::make_unordered_set<frozen::string>({ ".bmp", ".gif", ".hdr", ".jpg", ".jpeg", ".pic", ".png", ".ppm", ".pgm", ".psd", ".tga" });

View File

@@ -230,7 +230,7 @@ namespace Nz
{ ".tga", &SaveTGA }
});
bool FormatQuerier(const std::string_view& extension)
bool FormatQuerier(std::string_view extension)
{
return s_formatHandlers.find(extension) != s_formatHandlers.end();
}

View File

@@ -182,7 +182,7 @@ namespace Nz
return false;
};
void SimpleTextDrawer::GenerateGlyphs(const std::string_view& text) const
void SimpleTextDrawer::GenerateGlyphs(std::string_view text) const
{
if (text.empty())
return;