aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilip Kaludercic2022-04-14 11:00:07 +0200
committerPhilip Kaludercic2022-04-14 18:39:35 +0200
commit17b639aabb457ca6ffbcb6fdb73c03571fb0e360 (patch)
treefbfcc996270fb4d7160c93b3c8c6261d22110e0e /src
parent346749f67db3fd2c0cca0b5615d9fc3f878aa65f (diff)
downloademacs-17b639aabb457ca6ffbcb6fdb73c03571fb0e360.tar.gz
emacs-17b639aabb457ca6ffbcb6fdb73c03571fb0e360.zip
Avoid possibly unnecessary lisp_time_struct call
* timefns.c (time_cmp): Defer the calculation of the time struct, in case A and B are eq to one another.
Diffstat (limited to 'src')
-rw-r--r--src/timefns.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/timefns.c b/src/timefns.c
index 9e8592d35ac..6cfb787af8f 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1219,8 +1219,6 @@ time_cmp (Lisp_Object a, Lisp_Object b)
1219 return da < db ? -1 : da != db; 1219 return da < db ? -1 : da != db;
1220 } 1220 }
1221 1221
1222 struct lisp_time ta = lisp_time_struct (a, 0);
1223
1224 /* Compare nil to nil correctly, and handle other eq values quicker 1222 /* Compare nil to nil correctly, and handle other eq values quicker
1225 while we're at it. Compare here rather than earlier, to handle 1223 while we're at it. Compare here rather than earlier, to handle
1226 NaNs and check formats. */ 1224 NaNs and check formats. */
@@ -1229,6 +1227,7 @@ time_cmp (Lisp_Object a, Lisp_Object b)
1229 1227
1230 /* Compare (ATICKS . AZ) to (BTICKS . BHZ) by comparing 1228 /* Compare (ATICKS . AZ) to (BTICKS . BHZ) by comparing
1231 ATICKS * BHZ to BTICKS * AHZ. */ 1229 ATICKS * BHZ to BTICKS * AHZ. */
1230 struct lisp_time ta = lisp_time_struct (a, 0);
1232 struct lisp_time tb = lisp_time_struct (b, 0); 1231 struct lisp_time tb = lisp_time_struct (b, 0);
1233 mpz_t const *za = bignum_integer (&mpz[0], ta.ticks); 1232 mpz_t const *za = bignum_integer (&mpz[0], ta.ticks);
1234 mpz_t const *zb = bignum_integer (&mpz[1], tb.ticks); 1233 mpz_t const *zb = bignum_integer (&mpz[1], tb.ticks);