Short-circuit hasDebugFlag to make it a bit faster in the common case
This commit is contained in:
parent
3e75255e6b
commit
ef339dcdd1
@ -123,7 +123,11 @@ bool hasDebugFlag(const char *flag)
|
||||
trace("INTERNAL ERROR: hasDebugFlag flag has comma: '%s'", flag);
|
||||
abort();
|
||||
}
|
||||
std::string config(getDebugConfig());
|
||||
const char *const configCStr = getDebugConfig();
|
||||
if (configCStr[0] == '\0') {
|
||||
return false;
|
||||
}
|
||||
std::string config(configCStr);
|
||||
std::string flagStr(flag);
|
||||
config = "," + config + ",";
|
||||
flagStr = "," + flagStr + ",";
|
||||
|
Loading…
Reference in New Issue
Block a user