diff options
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 1d4ea01..10e6317 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -10,10 +10,10 @@ #include <vector> #include <cm/memory> +#include <cmext/algorithm> #include "cm_uv.h" -#include "cmAlgorithms.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmFileMonitor.h" #include "cmGlobalGenerator.h" @@ -182,7 +182,7 @@ static bool getOrTestHomeDirectory(cmState* state, std::string& value, std::string* errorMessage) { const std::string cachedValue = - std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY")); + *state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"); if (value.empty()) { value = cachedValue; return true; @@ -205,9 +205,7 @@ static bool getOrTestValue(cmState* state, const std::string& key, const std::string& keyDescription, std::string* errorMessage) { - const char* entry = state->GetCacheEntryValue(key); - const std::string cachedValue = - entry == nullptr ? std::string() : std::string(entry); + const std::string cachedValue = state->GetSafeCacheEntryValue(key); if (value.empty()) { value = cachedValue; } @@ -435,7 +433,7 @@ cmServerResponse cmServerProtocol1::ProcessCache( keys = allKeys; } else { for (auto const& i : keys) { - if (!cmContains(allKeys, i)) { + if (!cm::contains(allKeys, i)) { return request.ReportError("Key \"" + i + "\" not found in cache."); } } @@ -452,7 +450,7 @@ cmServerResponse cmServerProtocol1::ProcessCache( bool haveProperties = false; for (auto const& prop : state->GetCacheEntryPropertyList(key)) { haveProperties = true; - props[prop] = state->GetCacheEntryProperty(key, prop); + props[prop] = *state->GetCacheEntryProperty(key, prop); } if (haveProperties) { entry[kPROPERTIES_KEY] = props; |