Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: include/core/SkRect.h

Issue 809443002: Rewrite NaN checks in terms of SkScalarIsNaN() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPoint.h ('k') | include/core/SkScalar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRect.h
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 394e45d4ca3866ce4c000af3dd05df399554da2d..0038c7c2fa2bbe3ad4fa14f403151ef9553063c6 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -455,11 +455,11 @@ struct SK_API SkRect {
accum *= fBottom;
// accum is either NaN or it is finite (zero).
- SkASSERT(0 == accum || !(accum == accum));
+ SkASSERT(0 == accum || SkScalarIsNaN(accum));
// value==value will be true iff value is not NaN
// TODO: is it faster to say !accum or accum==accum?
- return accum == accum;
+ return !SkScalarIsNaN(accum);
}
SkScalar x() const { return fLeft; }
« no previous file with comments | « include/core/SkPoint.h ('k') | include/core/SkScalar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698