diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-12 12:36:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-13 14:24:51 (GMT) |
commit | 73d52a862bfe73f591458b47a016b7400057ecab (patch) | |
tree | e15b631885a81ad58dcc7dd4435809d3e694ac49 /Source/cmPropertyDefinition.cxx | |
parent | f86d8009c6a4482c81221114a2b04b375564cc94 (diff) | |
download | CMake-73d52a862bfe73f591458b47a016b7400057ecab.zip CMake-73d52a862bfe73f591458b47a016b7400057ecab.tar.gz CMake-73d52a862bfe73f591458b47a016b7400057ecab.tar.bz2 |
cmPropertyDefinition: Construct directly in defined state
Move `cmPropertyDefinitionMap::DefineProperty` functionality
directly into the constructor to avoid an intermediate state.
Diffstat (limited to 'Source/cmPropertyDefinition.cxx')
-rw-r--r-- | Source/cmPropertyDefinition.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/cmPropertyDefinition.cxx b/Source/cmPropertyDefinition.cxx index 6a3174c..c8efaf6 100644 --- a/Source/cmPropertyDefinition.cxx +++ b/Source/cmPropertyDefinition.cxx @@ -2,19 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPropertyDefinition.h" -void cmPropertyDefinition::DefineProperty(const std::string& name, - cmProperty::ScopeType scope, - const char* shortDescription, - const char* fullDescription, - bool chain) +#include <utility> + +cmPropertyDefinition::cmPropertyDefinition(std::string name, + cmProperty::ScopeType scope, + std::string shortDescription, + std::string fullDescription, + bool chain) + : Name(std::move(name)) + , ShortDescription(std::move(shortDescription)) + , FullDescription(std::move(fullDescription)) + , Scope(scope) + , Chained(chain) { - this->Name = name; - this->Scope = scope; - this->Chained = chain; - if (shortDescription) { - this->ShortDescription = shortDescription; - } - if (fullDescription) { - this->FullDescription = fullDescription; - } } |