From: Paul Eggert Date: Sun, 7 Jul 2024 14:05:52 +0000 (+0200) Subject: Refactor decode_ticks_hz via switch X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b4d388d6c57427a03505ef4b539295543c724fdc;p=emacs.git Refactor decode_ticks_hz via switch * src/timefns.c (decode_ticks_hz): Change ?: to ‘switch’, for benefit of future changes. (cherry picked from commit c45ae286b540f1fc4e424a04eb1d423037cab19c) --- diff --git a/src/timefns.c b/src/timefns.c index a7a7d552506..ac41a3d6958 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -606,9 +606,14 @@ union c_time static union c_time decode_ticks_hz (Lisp_Object ticks, Lisp_Object hz, enum cform cform) { - return (cform == CFORM_DOUBLE - ? (union c_time) { .d = frac_to_double (ticks, hz) } - : (union c_time) { .lt = { .ticks = ticks, .hz = hz } }); + switch (cform) + { + case CFORM_DOUBLE: + return (union c_time) { .d = frac_to_double (ticks, hz) }; + + default: + return (union c_time) { .lt = { .ticks = ticks, .hz = hz } }; + } } /* Convert the finite number T into an Emacs time, truncating