Improve StaticString hashing
In a lot of case the StaticString hash can be computed a compile time, so we now take advantage of that. Removed StaticString(const char*) ctor, and replaced it with a StaticString::make() method. Fixed a couple wrong uses of the old StaticString(const char*) ctor.
This commit is contained in:
committed by
Mathias Agopian
parent
d135108763
commit
2d6b43827e
@@ -361,8 +361,8 @@ Filter filterFromString(const char* rawname) {
|
||||
{ "MINIMUM", Filter::MINIMUM},
|
||||
};
|
||||
string name = rawname;
|
||||
for (auto& c: name) c = toupper((unsigned char) c);
|
||||
auto iter = map.find({ name.c_str(), name.size() });
|
||||
for (auto& c: name) { c = toupper((unsigned char)c); }
|
||||
auto iter = map.find(StaticString::make(name.c_str(), name.size()));
|
||||
return iter == map.end() ? Filter::DEFAULT : iter->second;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user