summaryrefslogtreecommitdiffstats
path: root/Source/cmPropertyDefinition.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-12 12:36:43 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-13 14:24:51 (GMT)
commit73d52a862bfe73f591458b47a016b7400057ecab (patch)
treee15b631885a81ad58dcc7dd4435809d3e694ac49 /Source/cmPropertyDefinition.cxx
parentf86d8009c6a4482c81221114a2b04b375564cc94 (diff)
downloadCMake-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.cxx26
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;
- }
}