Index: include/core/SkRect.h |
diff --git a/include/core/SkRect.h b/include/core/SkRect.h |
index 96bf0f4d9088bf64e8c02dea5e5d625bc9752564..91765424c71643dd2544c10406d31e221552c4ed 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<SkScalar>(fLeft, fRight); |
+ } |
+ |
+ if (fTop > fBottom) { |
+ SkTSwap<SkScalar>(fTop, fBottom); |
+ } |
} |
/** |