From 0e922d4085f0285cf353323fd5a96edae604d5da Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Mon, 2 Nov 2020 21:36:20 +0100 Subject: Integrate NAN check into assignment The check for NAN is kept to avoid relying on implementation details of the CLAMP macro/function --- dragonflybsd/Platform.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'dragonflybsd/Platform.c') diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 5f9f6373..604994c4 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -176,10 +176,7 @@ double Platform_setCPUValues(Meter* this, int cpu) { percent = v[0] + v[1] + v[2]; } - percent = CLAMP(percent, 0.0, 100.0); - if (isnan(percent)) { - percent = 0.0; - } + percent = isnan(percent) ? 0.0 : CLAMP(percent, 0.0, 100.0); v[CPU_METER_FREQUENCY] = NAN; -- cgit v1.2.3