]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/data.c (arithcompare): Simplify fixnum/bignum comparisons.
authorMattias EngdegÄrd <mattiase@acm.org>
Sat, 27 Jul 2024 11:38:57 +0000 (13:38 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Jul 2024 16:24:13 +0000 (18:24 +0200)
Noticed by Pip Cet.

(cherry picked from commit e5a94491170bdde62c1afa19ec86e16a07429395)

src/data.c

index b4d08a3ff06c0344f991ba743dd06d04ece80199..40b5a42b65bde33dddd046b831dcad3cfa0f0c70 100644 (file)
@@ -2768,7 +2768,8 @@ arithcompare (Lisp_Object num1, Lisp_Object num2)
       else
        {
          int sgn = mpz_sgn (*xbignum_val (num2));
-         eq = sgn == 0;
+         eassume (sgn != 0);
+         eq = false;
          lt = sgn > 0;
          gt = sgn < 0;
        }
@@ -2789,7 +2790,8 @@ arithcompare (Lisp_Object num1, Lisp_Object num2)
   else if (FIXNUMP (num2))
     {
       int sgn = mpz_sgn (*xbignum_val (num1));
-      eq = sgn == 0;
+      eassume (sgn != 0);
+      eq = false;
       lt = sgn < 0;
       gt = sgn > 0;
     }