Commit 37d3c161 authored by Paul Eggert's avatar Paul Eggert

Tiny simplification of frac_to_double

* src/timefns.c (frac_to_double): Remove unnecessary runtime check,
since the denominator is always positive.
parent efb5115b
Pipeline #5048 passed with stage
in 52 minutes and 13 seconds
......@@ -593,7 +593,7 @@ timespec_to_lisp (struct timespec t)
}
/* Return NUMERATOR / DENOMINATOR, rounded to the nearest double.
Arguments must be Lisp integers, and DENOMINATOR must be nonzero. */
Arguments must be Lisp integers, and DENOMINATOR must be positive. */
static double
frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
{
......@@ -601,7 +601,6 @@ frac_to_double (Lisp_Object numerator, Lisp_Object denominator)
if (FASTER_TIMEFNS
&& integer_to_intmax (numerator, &intmax_numerator)
&& integer_to_intmax (denominator, &intmax_denominator)
&& ! INT_DIVIDE_OVERFLOW (intmax_numerator, intmax_denominator)
&& intmax_numerator % intmax_denominator == 0)
return intmax_numerator / intmax_denominator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment