Misc: Pass string_view by value

This commit is contained in:
Stenzek
2024-05-05 20:21:54 +10:00
parent e4d940a476
commit ca3cfbaa99
111 changed files with 543 additions and 542 deletions

View File

@@ -55,10 +55,10 @@ struct GlyphInfo
};
static QString FixLanguageName(const QString& language);
static void UpdateGlyphRangesAndClearCache(QWidget* dialog_parent, const std::string_view& language);
static void UpdateGlyphRangesAndClearCache(QWidget* dialog_parent, std::string_view language);
static bool DownloadMissingFont(QWidget* dialog_parent, const char* font_name, const char* font_url,
const std::string& path);
static const GlyphInfo* GetGlyphInfo(const std::string_view& language);
static const GlyphInfo* GetGlyphInfo(std::string_view language);
static constexpr const char* DEFAULT_IMGUI_FONT_NAME = "Roboto-Regular.ttf";
#define MAKE_FONT_DOWNLOAD_URL(name) "https://www.duckstation.org/runtime-resources/fonts/" name
@@ -156,7 +156,7 @@ QString QtHost::FixLanguageName(const QString& language)
return language;
}
s32 Host::Internal::GetTranslatedStringImpl(const std::string_view& context, const std::string_view& msg, char* tbuf,
s32 Host::Internal::GetTranslatedStringImpl(std::string_view context, std::string_view msg, char* tbuf,
size_t tbuf_space)
{
// This is really awful. Thankfully we're caching the results...
@@ -220,7 +220,7 @@ static constexpr const ImWchar s_central_european_ranges[] = {
0x0100, 0x017F, // Central European diacritics
};
void QtHost::UpdateGlyphRangesAndClearCache(QWidget* dialog_parent, const std::string_view& language)
void QtHost::UpdateGlyphRangesAndClearCache(QWidget* dialog_parent, std::string_view language)
{
const GlyphInfo* gi = GetGlyphInfo(language);
@@ -357,7 +357,7 @@ static constexpr const QtHost::GlyphInfo s_glyph_info[] = {
};
// clang-format on
const QtHost::GlyphInfo* QtHost::GetGlyphInfo(const std::string_view& language)
const QtHost::GlyphInfo* QtHost::GetGlyphInfo(std::string_view language)
{
for (const GlyphInfo& it : s_glyph_info)
{