[PD] Use compare to compare strings instead of substr
Used when finding subelements of a feature. Many of the comparisons used to also check for string lengths, but as far as I can tell they are not strictly necessary (see https://www.cplusplus.com/reference/string/string/substr/) and just `substr` can be used without them. However, `compare` explicitly is for comparing, and does not make a new object that `substr` does.
This commit is contained in:
@@ -84,7 +84,7 @@ void TaskExtrudeParameters::setupDialog()
|
||||
int faceId = -1;
|
||||
if (obj && !subStrings.empty()) {
|
||||
upToFace = subStrings.front();
|
||||
if (upToFace.substr(0,4) == "Face")
|
||||
if (upToFace.compare(0, 4, "Face") == 0)
|
||||
faceId = std::atoi(&upToFace[4]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user