diff --git a/src/sksl/SkSLConstantFolder.cpp b/src/sksl/SkSLConstantFolder.cpp index 2f5645ac1c..a2de6906d7 100644 --- a/src/sksl/SkSLConstantFolder.cpp +++ b/src/sksl/SkSLConstantFolder.cpp @@ -176,8 +176,8 @@ static bool is_constant_value(const Expression& expr, double value) { return true; } -bool ConstantFolder::ErrorOnDivideByZero(const Context& context, int line, Operator op, - const Expression& right) { +static bool error_on_divide_by_zero(const Context& context, int line, Operator op, + const Expression& right) { switch (op.kind()) { case Token::Kind::TK_SLASH: case Token::Kind::TK_SLASHEQ: @@ -398,7 +398,7 @@ std::unique_ptr ConstantFolder::Simplify(const Context& context, return Literal::MakeBool(context, leftExpr.fLine, /*value=*/false); } - if (ErrorOnDivideByZero(context, line, op, *right)) { + if (error_on_divide_by_zero(context, line, op, *right)) { return nullptr; } diff --git a/src/sksl/SkSLConstantFolder.h b/src/sksl/SkSLConstantFolder.h index 6692dd222f..45643e01bc 100644 --- a/src/sksl/SkSLConstantFolder.h +++ b/src/sksl/SkSLConstantFolder.h @@ -49,13 +49,6 @@ public: static std::unique_ptr MakeConstantValueForVariable( std::unique_ptr expr); - /** - * Reports an error and returns true if op is a division / mod operator and right is zero or - * contains a zero element. - */ - static bool ErrorOnDivideByZero(const Context& context, int line, Operator op, - const Expression& right); - /** Simplifies the binary expression `left OP right`. Returns null if it can't be simplified. */ static std::unique_ptr Simplify(const Context& context, int line,