diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2021-07-26 18:45:03 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2021-07-26 20:40:18 (GMT) |
commit | bf2fe903728a56755d045c768fc6cc0d46845cc5 (patch) | |
tree | 628370958badebfcaefda539aa0541b4f55d32fe /Source/cmConditionEvaluator.h | |
parent | 7bec39dc10e821571785e503a1c14f09db8004a9 (diff) | |
download | CMake-bf2fe903728a56755d045c768fc6cc0d46845cc5.zip CMake-bf2fe903728a56755d045c768fc6cc0d46845cc5.tar.gz CMake-bf2fe903728a56755d045c768fc6cc0d46845cc5.tar.bz2 |
Refactor: Speedup predicates and binary operation
Before predicates and binary ops reducers use series of `if ()` blocks
to match the keywords. However, if matched the currect `arg` get replaced
with evaluation result, so further `if (<match-another-keyword>)`
is just wasting time/resources.
This patch introduce a chain of `if` → `else if` → ..., so after
first match the loop restarts w/ the next argument.
Diffstat (limited to 'Source/cmConditionEvaluator.h')
-rw-r--r-- | Source/cmConditionEvaluator.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index af0dc5c..a7e3ce8 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -38,7 +38,7 @@ private: cmProp GetVariableOrString(const cmExpandedCommandArgument& argument) const; - bool IsKeyword(cm::string_view keyword, + bool IsKeyword(cm::static_string_view keyword, cmExpandedCommandArgument& argument) const; bool GetBooleanValue(cmExpandedCommandArgument& arg) const; |