I was reviewing rts/System/StringUtil.h, I saw that StrCaseStr is inline function along with two global static buffers
static char lcstr[32768];
static char lcsub[32768];
static inline const char* StrCaseStr(const char* str, const char* sub) {
const char* pos = nullptr;
if (str == nullptr)
return nullptr;
if (sub == nullptr)
return nullptr;
std::strncpy(lcstr, str, sizeof(lcstr) - 1);
std::strncpy(lcsub, sub, sizeof(lcsub) - 1);
std::transform(lcstr, lcstr + sizeof(lcstr), lcstr, (int (*)(int)) tolower);
std::transform(lcsub, lcsub + sizeof(lcsub), lcsub, (int (*)(int)) tolower);
if ((pos = std::strstr(lcstr, lcsub)) == nullptr)
return nullptr;
return (str + (pos - lcstr));
}
i think we would remove lcstr,lcsub,StrCaseStr
and refactor the single usage in CMiniMap::ConfigCommand to use hashStringLower
if you think it is a good idea assign the task to me and i will do it asap
I was reviewing
rts/System/StringUtil.h, I saw thatStrCaseStris inline function along with two global static buffersi think we would remove
lcstr,lcsub,StrCaseStrand refactor the single usage in
CMiniMap::ConfigCommandto usehashStringLowerif you think it is a good idea assign the task to me and i will do it asap