Decompose a weird assert.
authormtklein <mtklein@chromium.org>
Wed, 3 Dec 2014 16:48:57 +0000 (08:48 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Dec 2014 16:48:57 +0000 (08:48 -0800)
I got my hands on a list of new warnings coming out of MSVC when run with /analyze.

I scanned over them and didn't see any bugs, but I did notice this is just a weird
way to write this expression. (MSVC /analyze was wary of '=' in a boolean expression.)

BUG=skia:

Review URL: https://codereview.chromium.org/776033002

src/utils/SkTextureCompressor_Blitter.h

index 3d30501..0c26a7a 100644 (file)
@@ -309,7 +309,8 @@ public:
     virtual void blitMask(const SkMask& mask, const SkIRect& clip) SK_OVERRIDE {
 
         // Assumptions:
-        SkASSERT(!fBlitMaskCalled && (fBlitMaskCalled = true));
+        SkASSERT(!fBlitMaskCalled);
+        SkDEBUGCODE(fBlitMaskCalled = true);
         SkASSERT(SkMask::kA8_Format == mask.fFormat);
         SkASSERT(mask.fBounds.contains(clip));