Index: src/pathops/SkDCubicToQuads.cpp |
diff --git a/src/pathops/SkDCubicToQuads.cpp b/src/pathops/SkDCubicToQuads.cpp |
index 3cf63f31d02986b2d16a59a7eced1602d4adbf4d..705320d2085c5c8edde0fc458e3ca62c44176385 100644 |
--- a/src/pathops/SkDCubicToQuads.cpp |
+++ b/src/pathops/SkDCubicToQuads.cpp |
@@ -136,17 +136,16 @@ void SkDCubic::toQuadraticTs(double precision, SkTArray<double, true>* ts) const |
memmove(inflectT, &inflectT[1], sizeof(inflectT[0]) * --inflections); |
} |
int start = 0; |
- do { |
- int next = start + 1; |
- if (next >= inflections) { |
- break; |
- } |
+ int next = 1; |
+ while (next < inflections) { |
if (!approximately_equal(inflectT[start], inflectT[next])) { |
++start; |
+ ++next; |
continue; |
} |
memmove(&inflectT[start], &inflectT[next], sizeof(inflectT[0]) * (--inflections - start)); |
- } while (true); |
+ } |
+ |
while (inflections && approximately_greater_than_one(inflectT[inflections - 1])) { |
--inflections; |
} |