summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.h
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2021-07-26 18:45:03 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2021-07-26 20:40:18 (GMT)
commitbf2fe903728a56755d045c768fc6cc0d46845cc5 (patch)
tree628370958badebfcaefda539aa0541b4f55d32fe /Source/cmConditionEvaluator.h
parent7bec39dc10e821571785e503a1c14f09db8004a9 (diff)
downloadCMake-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.h2
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;