summaryrefslogtreecommitdiffstats
path: root/dragonflybsd
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-02 21:36:20 +0100
committerBenny Baumann <BenBE@geshi.org>2020-11-02 22:15:01 +0100
commit0e922d4085f0285cf353323fd5a96edae604d5da (patch)
treee90b8301dc32651f0bb5665f634a9bd0e8eb43c6 /dragonflybsd
parentcb8bb12974af25fc845acc008c529eb86835fe6f (diff)
Integrate NAN check into assignment
The check for NAN is kept to avoid relying on implementation details of the CLAMP macro/function
Diffstat (limited to 'dragonflybsd')
-rw-r--r--dragonflybsd/Platform.c5
1 files changed, 1 insertions, 4 deletions
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy