Commit 0e4493ec authored by Sebastian Holtermann's avatar Sebastian Holtermann

cmOutputConverter: Initialize static std::set on construction

parent f1bdfdf2
......@@ -73,22 +73,10 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
static bool cmOutputConverterIsShellOperator(const std::string& str)
{
static std::set<std::string> shellOperators;
if (shellOperators.empty()) {
shellOperators.insert("<");
shellOperators.insert(">");
shellOperators.insert("<<");
shellOperators.insert(">>");
shellOperators.insert("|");
shellOperators.insert("||");
shellOperators.insert("&&");
shellOperators.insert("&>");
shellOperators.insert("1>");
shellOperators.insert("2>");
shellOperators.insert("2>&1");
shellOperators.insert("1>&2");
}
return shellOperators.count(str) > 0;
static std::set<std::string> const shellOperators{
"<", ">", "<<", ">>", "|", "||", "&&", "&>", "1>", "2>", "2>&1", "1>&2"
};
return (shellOperators.count(str) != 0);
}
std::string cmOutputConverter::EscapeForShell(const std::string& str,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment