remove needless check for std::string::substr()

Passing npos is legal and means "rest of the string".
This commit is contained in:
Rolf Eike Beer
2020-03-18 18:52:36 +01:00
parent a42d2b099a
commit d6cf89c0d4
+1 -2
View File
@@ -55,8 +55,7 @@ cmCPackIFWPackage::DependenceStruct::DependenceStruct(
if (dashPos != std::string::npos) {
pos = dashPos;
}
this->Name =
pos == std::string::npos ? dependence : dependence.substr(0, pos);
this->Name = dependence.substr(0, pos);
}
std::string cmCPackIFWPackage::DependenceStruct::NameWithCompare() const