]> git.eshelyaron.com Git - emacs.git/commit
Make time arithmetic more like comparison
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Aug 2022 07:38:32 +0000 (00:38 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Aug 2022 08:17:13 +0000 (01:17 -0700)
commit914cf4b91ba8bdf63cd10a66f970c396329beeab
treeedf43bdb4f21bcb3e4f3c53e32d87a898c60da38
parente3b6242938fa9bcc3aebaa0eddd6aa561136dbf1
Make time arithmetic more like comparison

Since time comparison says X == X, have time arithmetic behave
similarly for X - X.  This should also be a bit faster due to not
having to test for floats and NaNs.
* src/timefns.c (time_arith, time_cmp):
Simplify by not worrying about NaNs, which are not time values.
(time_arith): Simplify by not worrying about subtracting nil from
nil; the caller now handles this.
(Ftime_subtract): Handle subtracting X from X specially.
src/timefns.c