summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 20:45:24 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 20:45:24 (GMT)
commit516f8edb2e061749c56b6f9a58332fbf59e45a1a (patch)
tree82ebe3f38b5248ef0b78586019ac1dca44ce2370 /Source/cmGetPropertyCommand.cxx
parentd9f5d3c50fe376423382d6445f7fb2906a43469e (diff)
downloadCMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.zip
CMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.tar.gz
CMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.tar.bz2
Avoid else after return
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r--Source/cmGetPropertyCommand.cxx34
1 files changed, 14 insertions, 20 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 2307e08..3aef9cf 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -252,19 +252,17 @@ bool cmGetPropertyCommand::HandleTargetMode()
if (this->PropertyName == "ALIASED_TARGET") {
if (this->Makefile->IsAlias(this->Name)) {
return this->StoreResult(target->GetName().c_str());
- } else {
- return this->StoreResult(NULL);
}
+ return this->StoreResult(NULL);
}
return this->StoreResult(
target->GetProperty(this->PropertyName, this->Makefile));
- } else {
- std::ostringstream e;
- e << "could not find TARGET " << this->Name
- << ". Perhaps it has not yet been created.";
- this->SetError(e.str());
- return false;
}
+ std::ostringstream e;
+ e << "could not find TARGET " << this->Name
+ << ". Perhaps it has not yet been created.";
+ this->SetError(e.str());
+ return false;
}
bool cmGetPropertyCommand::HandleSourceMode()
@@ -277,13 +275,11 @@ bool cmGetPropertyCommand::HandleSourceMode()
// Get the source file.
if (cmSourceFile* sf = this->Makefile->GetOrCreateSource(this->Name)) {
return this->StoreResult(sf->GetPropertyForUser(this->PropertyName));
- } else {
- std::ostringstream e;
- e << "given SOURCE name that could not be found or created: "
- << this->Name;
- this->SetError(e.str());
- return false;
}
+ std::ostringstream e;
+ e << "given SOURCE name that could not be found or created: " << this->Name;
+ this->SetError(e.str());
+ return false;
}
bool cmGetPropertyCommand::HandleTestMode()
@@ -347,11 +343,9 @@ bool cmGetPropertyCommand::HandleInstallMode()
bool isSet = file->GetProperty(this->PropertyName, value);
return this->StoreResult(isSet ? value.c_str() : CM_NULLPTR);
- } else {
- std::ostringstream e;
- e << "given INSTALL name that could not be found or created: "
- << this->Name;
- this->SetError(e.str());
- return false;
}
+ std::ostringstream e;
+ e << "given INSTALL name that could not be found or created: " << this->Name;
+ this->SetError(e.str());
+ return false;
}