diff options
| author | Alex Turbov <i.zaufi@gmail.com> | 2022-10-26 15:09:54 +0400 |
|---|---|---|
| committer | Alex Turbov <i.zaufi@gmail.com> | 2022-11-17 16:37:13 +0400 |
| commit | 6e3e8827faf0bf2363ecf9035b5573e715e52fb2 (patch) | |
| tree | 21681997c33a843eb61cd66d76651b5a3b4f220c /Source/cmake.cxx | |
| parent | e99a4acbcd2f7ec8e5cefbf996af1dfa95e61a27 (diff) | |
| download | cmake-6e3e8827faf0bf2363ecf9035b5573e715e52fb2.tar.gz | |
Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entry
Before, a documentation entry was in/out parameter.
Now it's a normal return value.
This also makes possible to eliminate defaulted default ctor
for `cmDocumentationEntry` for C++ 11.
Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
Diffstat (limited to 'Source/cmake.cxx')
| -rw-r--r-- | Source/cmake.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 62f926e6b9..befcb55135 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2949,17 +2949,15 @@ void cmake::AppendGlobalGeneratorsDocumentation( std::vector<cmDocumentationEntry>& v) { const auto defaultGenerator = this->EvaluateDefaultGlobalGenerator(); - const std::string defaultName = defaultGenerator->GetName(); - bool foundDefaultOne = false; + const auto defaultName = defaultGenerator->GetName(); + auto foundDefaultOne = false; for (const auto& g : this->Generators) { - cmDocumentationEntry e; - g->GetDocumentation(e); - if (!foundDefaultOne && cmHasPrefix(e.Name, defaultName)) { - e.CustomNamePrefix = '*'; + v.emplace_back(g->GetDocumentation()); + if (!foundDefaultOne && cmHasPrefix(v.back().Name, defaultName)) { + v.back().CustomNamePrefix = '*'; foundDefaultOne = true; } - v.push_back(std::move(e)); } } |
