FullscreenUI: Avoid per-frame memory allocations with SmallString

This commit is contained in:
Stenzek
2024-04-07 20:43:13 +10:00
parent 631fca3042
commit de1a1af908
6 changed files with 102 additions and 130 deletions

View File

@ -370,12 +370,12 @@ std::string InputManager::ConvertInputBindingKeysToString(InputBindingInfo::Type
return ss.str();
}
bool InputManager::PrettifyInputBinding(std::string& binding)
bool InputManager::PrettifyInputBinding(SmallStringBase& binding)
{
if (binding.empty())
return false;
const std::string_view binding_view(binding);
const std::string_view binding_view = binding.view();
SmallString ret;
bool changed = false;
@ -408,7 +408,7 @@ bool InputManager::PrettifyInputBinding(std::string& binding)
}
if (changed)
binding = ret.view();
binding = ret;
return changed;
}