From bdaadbdc2b6f7cb9eea1392043f225da85f51b5b Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Mon, 20 Jun 2016 23:11:05 +0200 Subject: cmOutputConverter: collapse ConvertToOutputForExisting functions --- Source/cmOutputConverter.cxx | 24 ++++++------------------ Source/cmOutputConverter.h | 4 ---- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index e66158e..03d8376 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -27,10 +27,12 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot) assert(this->StateSnapshot.IsValid()); } -std::string cmOutputConverter::ConvertToOutputForExistingCommon( - const std::string& remote, std::string const& result, - OutputFormat format) const +std::string cmOutputConverter::ConvertToOutputForExisting( + const std::string& remote, OutputFormat format) const { + // Perform standard conversion. + std::string result = this->ConvertToOutputFormat(remote, format); + // If this is a windows shell, the result has a space, and the path // already exists, we can use a short-path to reference it without a // space. @@ -47,16 +49,6 @@ std::string cmOutputConverter::ConvertToOutputForExistingCommon( } std::string cmOutputConverter::ConvertToOutputForExisting( - const std::string& remote, OutputFormat format) const -{ - // Perform standard conversion. - std::string result = this->ConvertToOutputFormat(remote, format); - - // Consider short-path. - return this->ConvertToOutputForExistingCommon(remote, result, format); -} - -std::string cmOutputConverter::ConvertToOutputForExisting( RelativeRoot remote, OutputFormat format) const { // The relative root must have a path (i.e. not FULL or NONE) @@ -66,11 +58,7 @@ std::string cmOutputConverter::ConvertToOutputForExisting( const char* remotePath = this->GetRelativeRootPath(remote); assert(remotePath != 0); - // Perform standard conversion. - std::string result = this->ConvertToOutputFormat(remotePath, format); - - // Consider short-path. - return this->ConvertToOutputForExistingCommon(remotePath, result, format); + return this->ConvertToOutputForExisting(remotePath, format); } const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 3d7d493..23f2e62 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -159,10 +159,6 @@ public: private: cmState* GetState() const; - std::string ConvertToOutputForExistingCommon(const std::string& remote, - std::string const& result, - OutputFormat format) const; - static int Shell__CharIsWhitespace(char c); static int Shell__CharNeedsQuotesOnUnix(char c); static int Shell__CharNeedsQuotesOnWindows(char c); -- cgit v0.12