mirror of https://gitee.com/bigwinds/arangodb
use two simple regexes to workaround macos compilers producing endless loops (#9281)
This commit is contained in:
parent
48f9856e03
commit
b7f933c260
|
@ -25,16 +25,19 @@
|
|||
#include <regex>
|
||||
|
||||
namespace {
|
||||
std::regex const removeComments("(^[ \t]+|[ \t]*(#.*)?$)", std::regex::nosubs | std::regex::ECMAScript);
|
||||
std::regex const removeComments("#.*$", std::regex::ECMAScript);
|
||||
std::regex const removeTabs("^[ \t]+|[ \t]+$", std::regex::ECMAScript);
|
||||
}
|
||||
|
||||
namespace arangodb {
|
||||
namespace options {
|
||||
|
||||
std::string removeCommentsFromNumber(std::string const& value) {
|
||||
// replace leading spaces, replace trailing spaces & comments
|
||||
return std::regex_replace(value, ::removeComments, "");
|
||||
// replace trailing comments
|
||||
auto noComment = std::regex_replace(value, ::removeComments, "");
|
||||
// replace leading spaces, replace trailing spaces
|
||||
return std::regex_replace(noComment, ::removeTabs, "");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue