diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-06-04 10:24:44 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-06-04 16:11:19 (GMT) |
commit | 0e4493ec67865123d43034ef9bf1bd4919c705b1 (patch) | |
tree | 9ad2a5f2aba51547a802d0fa8e8df6f472194ec3 /Source/cmOutputConverter.cxx | |
parent | f1bdfdf2425d544b0cf897de626422ad3fa9e1e7 (diff) | |
download | CMake-0e4493ec67865123d43034ef9bf1bd4919c705b1.zip CMake-0e4493ec67865123d43034ef9bf1bd4919c705b1.tar.gz CMake-0e4493ec67865123d43034ef9bf1bd4919c705b1.tar.bz2 |
cmOutputConverter: Initialize static std::set on construction
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 7d88b08..d7bcf7e 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -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, |