1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[util] Move toLower transform to function

This commit is contained in:
Robin Kertels 2021-11-12 15:13:11 +01:00 committed by Joshie
parent 11f8b8ba44
commit eb9dfcedbd
2 changed files with 10 additions and 3 deletions

View File

@ -635,8 +635,7 @@ namespace dxvk {
I begin,
I end,
V& value) {
std::transform(str.begin(), str.end(), str.begin(),
[] (unsigned char c) { return (c >= 'A' && c <= 'Z') ? (c + 'a' - 'A') : c; });
str = Config::toLower(str);
for (auto i = begin; i != end; i++) {
if (str == i->first) {
@ -708,4 +707,10 @@ namespace dxvk {
}
}
std::string Config::toLower(std::string str) {
std::transform(str.begin(), str.end(), str.begin(),
[] (unsigned char c) { return (c >= 'A' && c <= 'Z') ? (c + 'a' - 'A') : c; });
return str;
}
}

View File

@ -102,6 +102,8 @@ namespace dxvk {
*/
static Config getUserConfig();
static std::string toLower(std::string str);
private:
OptionMap m_options;
@ -149,4 +151,4 @@ namespace dxvk {
option |= state == Tristate::True;
}
}
}