Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd55f1b5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Optimization for isZero to reduce processor instructions"

parents 528da9ff 1af13c81
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -31,7 +31,9 @@ public:
     * Check for floats that are close enough to zero.
     */
    inline static bool isZero(float value) {
        return (value >= -NON_ZERO_EPSILON) && (value <= NON_ZERO_EPSILON);
        // Using fabsf is more performant as ARM computes
        // fabsf in a single instruction.
        return fabsf(value) <= NON_ZERO_EPSILON;
    }

    inline static bool isOne(float value) {