diff options
author | Brad King <brad.king@kitware.com> | 2022-06-17 16:25:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-07-20 20:03:13 (GMT) |
commit | 84b335c2868d245841f08656b96cad3d9df10422 (patch) | |
tree | 0804559baeed10797beb771cc9bbb8699043247a /Source/cmArgumentParser.h | |
parent | a77b9c0ece8dbb2164c2c0f11c1f5368bd055f8a (diff) | |
download | CMake-84b335c2868d245841f08656b96cad3d9df10422.zip CMake-84b335c2868d245841f08656b96cad3d9df10422.tar.gz CMake-84b335c2868d245841f08656b96cad3d9df10422.tar.bz2 |
cmArgumentParser: Track pending keyword explicitly
Avoid allocating missing keyword vector unnecessarily.
Diffstat (limited to 'Source/cmArgumentParser.h')
-rw-r--r-- | Source/cmArgumentParser.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmArgumentParser.h b/Source/cmArgumentParser.h index 7cbef92..2d96f07 100644 --- a/Source/cmArgumentParser.h +++ b/Source/cmArgumentParser.h @@ -71,6 +71,7 @@ public: for (cm::string_view arg : args) { this->Consume(arg); } + this->FinishKeyword(); } private: @@ -80,11 +81,13 @@ private: std::vector<cm::string_view>* ParsedKeywords = nullptr; void* Result = nullptr; + cm::string_view Keyword; std::string* CurrentString = nullptr; std::vector<std::string>* CurrentList = nullptr; bool ExpectValue = false; void Consume(cm::string_view arg); + void FinishKeyword(); template <typename Result> friend class ::cmArgumentParser; |