diff options
Diffstat (limited to 'src/core/SkRecord.h')
-rw-r--r-- | src/core/SkRecord.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h index 1360f358b3..088975bc16 100644 --- a/src/core/SkRecord.h +++ b/src/core/SkRecord.h @@ -165,7 +165,8 @@ private: switch(this->type()) { SK_RECORD_TYPES(CASE) } #undef CASE SkDEBUGFAIL("Unreachable"); - return f(SkRecords::NoOp()); + static const SkRecords::NoOp noop{}; + return f(noop); } // Mutate this record with functor F (see public API above). @@ -175,7 +176,8 @@ private: switch(this->type()) { SK_RECORD_TYPES(CASE) } #undef CASE SkDEBUGFAIL("Unreachable"); - return f((SkRecords::NoOp*)nullptr); + static const SkRecords::NoOp noop{}; + return f(const_cast<SkRecords::NoOp*>(&noop)); } }; |