summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-20 20:31:57 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-20 20:32:02 (GMT)
commitb86007e385fc0f4cc45149b68cafebad749bf6e8 (patch)
treef8f0bde1fc04dcbf6201f133f74c983f11c10edb /Source
parentcde127b08441b23f7210bfe987812f8d253e960b (diff)
downloadCMake-b86007e385fc0f4cc45149b68cafebad749bf6e8.zip
CMake-b86007e385fc0f4cc45149b68cafebad749bf6e8.tar.gz
CMake-b86007e385fc0f4cc45149b68cafebad749bf6e8.tar.bz2
cmOutputConverter: remove 'optional' argument
Remove the 'optional' paramenter from the second overload of the Convert function. This parameter is used from one single location. Inline the codepath for which the argument is true to the callsite.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmOutputConverter.cxx17
-rw-r--r--Source/cmOutputConverter.h3
2 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index a45e37b..8f1e3af 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -61,11 +61,19 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
std::string cmOutputConverter::ConvertToOutputForExisting(
RelativeRoot remote, const std::string& local, OutputFormat format) const
{
+ static_cast<void>(local);
+
+ // The relative root must have a path (i.e. not FULL or NONE)
+ assert(remote != FULL);
+ assert(remote != NONE);
+
+ const char* remotePath = this->GetRelativeRootPath(remote);
+ assert(remotePath != 0);
+
// Perform standard conversion.
- std::string result = this->Convert(remote, local, format, true);
+ std::string result = this->ConvertToOutputFormat(remotePath, format);
// Consider short-path.
- const char* remotePath = this->GetRelativeRootPath(remote);
return this->ConvertToOutputForExistingCommon(remotePath, result, format);
}
@@ -158,8 +166,7 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
std::string cmOutputConverter::Convert(RelativeRoot remote,
const std::string& local,
- OutputFormat output,
- bool optional) const
+ OutputFormat output) const
{
// The relative root must have a path (i.e. not FULL or NONE)
assert(remote != FULL);
@@ -168,7 +175,7 @@ std::string cmOutputConverter::Convert(RelativeRoot remote,
const char* remotePath = this->GetRelativeRootPath(remote);
assert(remotePath != 0);
- if (local.empty() || optional) {
+ if (local.empty()) {
return this->ConvertToOutputFormat(remotePath, output);
}
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index f138d0e..f661572 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -58,8 +58,7 @@ public:
std::string Convert(const std::string& remote, RelativeRoot local,
OutputFormat output = UNCHANGED) const;
std::string Convert(RelativeRoot remote, const std::string& local,
- OutputFormat output = UNCHANGED,
- bool optional = false) const;
+ OutputFormat output = UNCHANGED) const;
std::string ConvertDirectorySeparatorsForShell(
const std::string& source) const;