Skip to content
This repository
Browse code

Make SetXXX methods case-sensitive.

This will make key search faster by 50%-75%.
This also can potentially break some bad-designed code, but in my test all is working fine.
  • Loading branch information...
commit 4ddbc49ccb6404ccf19742d1a2022c0a28d9be45 1 parent cd9e237
Karlson2k Karlson2k authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 xbmc/settings/GUISettings.cpp
8 xbmc/settings/GUISettings.cpp
@@ -1084,7 +1084,7 @@ bool CGUISettings::GetBool(const char *strSetting) const
1084 1084 void CGUISettings::SetBool(const char *strSetting, bool bSetting)
1085 1085 {
1086 1086 ASSERT(settingsMap.size());
1087   - mapIter it = settingsMap.find(CStdString(strSetting).ToLower());
  1087 + mapIter it = settingsMap.find(strSetting);
1088 1088 if (it != settingsMap.end())
1089 1089 { // old category
1090 1090 ((CSettingBool*)(*it).second)->SetData(bSetting);
@@ -1138,7 +1138,7 @@ float CGUISettings::GetFloat(const char *strSetting) const
1138 1138 void CGUISettings::SetFloat(const char *strSetting, float fSetting)
1139 1139 {
1140 1140 ASSERT(settingsMap.size());
1141   - mapIter it = settingsMap.find(CStdString(strSetting).ToLower());
  1141 + mapIter it = settingsMap.find(strSetting);
1142 1142 if (it != settingsMap.end())
1143 1143 {
1144 1144 ((CSettingFloat *)(*it).second)->SetData(fSetting);
@@ -1212,7 +1212,7 @@ int CGUISettings::GetInt(const char *strSetting) const
1212 1212 void CGUISettings::SetInt(const char *strSetting, int iSetting)
1213 1213 {
1214 1214 ASSERT(settingsMap.size());
1215   - mapIter it = settingsMap.find(CStdString(strSetting).ToLower());
  1215 + mapIter it = settingsMap.find(strSetting);
1216 1216 if (it != settingsMap.end())
1217 1217 {
1218 1218 ((CSettingInt *)(*it).second)->SetData(iSetting);
@@ -1286,7 +1286,7 @@ const CStdString &CGUISettings::GetString(const char *strSetting, bool bPrompt /
1286 1286 void CGUISettings::SetString(const char *strSetting, const char *strData)
1287 1287 {
1288 1288 ASSERT(settingsMap.size());
1289   - mapIter it = settingsMap.find(CStdString(strSetting).ToLower());
  1289 + mapIter it = settingsMap.find(strSetting);
1290 1290 if (it != settingsMap.end())
1291 1291 {
1292 1292 ((CSettingString *)(*it).second)->SetData(strData);

0 comments on commit 4ddbc49

Please sign in to comment.
Something went wrong with that request. Please try again.