From fdf63e4c93d40c1c4da43fdf13010d590dc133e0 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sun, 20 Oct 2019 04:45:29 +0200 Subject: [PATCH] Fix trim loop condition and outer continue --- src/extender.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/extender.cpp b/src/extender.cpp index 2ae54df98..b0add3857 100644 --- a/src/extender.cpp +++ b/src/extender.cpp @@ -1070,10 +1070,10 @@ namespace Sass { // the result so that, if two selectors are identical, we keep the first one. std::vector result; size_t numOriginals = 0; - // Use label to quit outer loop - redo: + size_t i = selectors.size(); + outer: // Use label to continue loop + while (--i != std::string::npos) { - for (size_t i = selectors.size() - 1; i != std::string::npos; i--) { const ComplexSelectorObj& complex1 = selectors[i]; // Check if selector in known in existing "originals" // For custom behavior dart-sass had `isOriginal(complex1)` @@ -1083,7 +1083,7 @@ namespace Sass { for (size_t j = 0; j < numOriginals; j++) { if (ObjEqualityFn(result[j], complex1)) { rotateSlice(result, 0, j + 1); - goto redo; + goto outer; } } result.insert(result.begin(), complex1);