Trim else after return

This commit is contained in:
sabrina-shanman 2019-08-26 14:30:47 -07:00
parent 388a70502e
commit ad1a98b85a

View file

@ -544,34 +544,34 @@ TestFilter::TestFilter(const QString& filterString) {
if (foundCategoryIt == propertyToProfileCategory.cend()) { if (foundCategoryIt == propertyToProfileCategory.cend()) {
error = "Invalid test filter property '" + referenceVariant + "'"; error = "Invalid test filter property '" + referenceVariant + "'";
return; return;
} else { }
ProfileCategory selectedFilterCategory = foundCategoryIt->second;
for (auto allowedVariantIt = ++(allowedVariants.cbegin()); allowedVariantIt != allowedVariants.cend(); ++allowedVariantIt) {
auto& currentVariant = *allowedVariantIt;
auto nextCategoryIt = propertyToProfileCategory.find(currentVariant);
if (nextCategoryIt == propertyToProfileCategory.cend()) {
error = "Invalid test filter property '" + referenceVariant + "'";
return;
}
auto& currentCategory = nextCategoryIt->second;
if (currentCategory != selectedFilterCategory) {
error = "Mismatched comma-separated test filter properties '" + referenceVariant + "' and '" + currentVariant + "'";
return;
}
// List of comma-separated test property variants is consistent so far
}
switch (selectedFilterCategory) { ProfileCategory selectedFilterCategory = foundCategoryIt->second;
case ProfileCategory::TIER: for (auto allowedVariantIt = ++(allowedVariants.cbegin()); allowedVariantIt != allowedVariants.cend(); ++allowedVariantIt) {
allowedTiers.insert(allowedTiers.cend(), allowedVariants.cbegin(), allowedVariants.cend()); auto& currentVariant = *allowedVariantIt;
break; auto nextCategoryIt = propertyToProfileCategory.find(currentVariant);
case ProfileCategory::OS: if (nextCategoryIt == propertyToProfileCategory.cend()) {
allowedOperatingSystems.insert(allowedOperatingSystems.cend(), allowedVariants.cbegin(), allowedVariants.cend()); error = "Invalid test filter property '" + referenceVariant + "'";
break; return;
case ProfileCategory::GPU:
allowedGPUs.insert(allowedGPUs.cend(), allowedVariants.cbegin(), allowedVariants.cend());
break;
} }
auto& currentCategory = nextCategoryIt->second;
if (currentCategory != selectedFilterCategory) {
error = "Mismatched comma-separated test filter properties '" + referenceVariant + "' and '" + currentVariant + "'";
return;
}
// List of comma-separated test property variants is consistent so far
}
switch (selectedFilterCategory) {
case ProfileCategory::TIER:
allowedTiers.insert(allowedTiers.cend(), allowedVariants.cbegin(), allowedVariants.cend());
break;
case ProfileCategory::OS:
allowedOperatingSystems.insert(allowedOperatingSystems.cend(), allowedVariants.cbegin(), allowedVariants.cend());
break;
case ProfileCategory::GPU:
allowedGPUs.insert(allowedGPUs.cend(), allowedVariants.cbegin(), allowedVariants.cend());
break;
} }
} }
} }