sourcemod
sourcemod copied to clipboard
Implement StringMap.IgnoreCase
Please, add the option to be able ignore case sensitivity of StringMap key.
StringMap hash system may not provide for case insensitivity. It is possible to use when adding and reading elements using only lower or upper case
like most implementations we could tolower the keys, although that would result in unexpected behaviour on the keys.
Why is this desired? what's the use-case?
Well, my case is using StringMap object to cache some stuff related to #phrases. Source Engine uses case insensitive look up for it, so I must mimic. At the moment I do CharToLower to store and retrieve StringMap values, but that's an additional performance consumption which could be done by setup new .IgnoreCase property of StringMap beforehand. I met other use-cases, but don't remember already.