From ad1a98b85a67309f2604362e867d0a5eafb030fc Mon Sep 17 00:00:00 2001 From: sabrina-shanman Date: Mon, 26 Aug 2019 14:30:47 -0700 Subject: [PATCH] Trim else after return --- tools/nitpick/src/TestCreator.cpp | 52 +++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/nitpick/src/TestCreator.cpp b/tools/nitpick/src/TestCreator.cpp index 412fc95390..e6a3224cf7 100644 --- a/tools/nitpick/src/TestCreator.cpp +++ b/tools/nitpick/src/TestCreator.cpp @@ -544,34 +544,34 @@ TestFilter::TestFilter(const QString& filterString) { if (foundCategoryIt == propertyToProfileCategory.cend()) { error = "Invalid test filter property '" + referenceVariant + "'"; 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) { - 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; + 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) { + 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; } } }