From b4d388d6c57427a03505ef4b539295543c724fdc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 7 Jul 2024 16:05:52 +0200 Subject: [PATCH] Refactor decode_ticks_hz via switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/timefns.c (decode_ticks_hz): Change ?: to ‘switch’, for benefit of future changes. (cherry picked from commit c45ae286b540f1fc4e424a04eb1d423037cab19c) --- src/timefns.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 -- 2.39.2