From 3840e2bf92d3eb18bd27144ddb46ede1f2b2d0a5 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 30 Jan 2024 12:07:28 +0100 Subject: [PATCH] Remove unnecessary if-statement --- contracts/Groth16Verifier.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/Groth16Verifier.sol b/contracts/Groth16Verifier.sol index 084c566..6d8d9ed 100644 --- a/contracts/Groth16Verifier.sol +++ b/contracts/Groth16Verifier.sol @@ -27,8 +27,7 @@ library Pairing { /// The negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory) { - if (p.x == 0 && p.y == 0) return G1Point(0, 0); - return G1Point(p.x, _Q - (p.y % _Q)); + return G1Point(p.x, (_Q - p.y) % _Q); } /// The sum of two points of G1