diff --git a/include/core/SkRect.h b/include/core/SkRect.h index 96bf0f4d90..91765424c7 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -843,15 +843,13 @@ public: * other. When this returns, left <= right && top <= bottom */ void sort() { - SkScalar min = SkMinScalar(fLeft, fRight); - SkScalar max = SkMaxScalar(fLeft, fRight); - fLeft = min; - fRight = max; - - min = SkMinScalar(fTop, fBottom); - max = SkMaxScalar(fTop, fBottom); - fTop = min; - fBottom = max; + if (fLeft > fRight) { + SkTSwap(fLeft, fRight); + } + + if (fTop > fBottom) { + SkTSwap(fTop, fBottom); + } } /**