diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-01-08 21:38:57 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-01-08 22:03:37 +0100 |
commit | d97cf58261d340922c85bee9b9e1670b4f88eafc (patch) | |
tree | daa6eb00a7c84e584255de6421e872179f4e305d /SwapMeter.c | |
parent | 650cf0f13bf667270d0a6a4612437af264667585 (diff) |
Improve code readability by creating constants for SWAP memory values
Diffstat (limited to 'SwapMeter.c')
-rw-r--r-- | SwapMeter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/SwapMeter.c b/SwapMeter.c index 081967fe..c0f48200 100644 --- a/SwapMeter.c +++ b/SwapMeter.c @@ -45,12 +45,12 @@ static void SwapMeter_display(const Object* cast, RichString* out) { RichString_writeAscii(out, CRT_colors[METER_TEXT], ":"); Meter_humanUnit(buffer, this->total, sizeof(buffer)); RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - Meter_humanUnit(buffer, this->values[0], sizeof(buffer)); + Meter_humanUnit(buffer, this->values[SWAP_METER_USED], sizeof(buffer)); RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:"); RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); - if (!isnan(this->values[1])) { - Meter_humanUnit(buffer, this->values[1], sizeof(buffer)); + if (!isnan(this->values[SWAP_METER_CACHE])) { + Meter_humanUnit(buffer, this->values[SWAP_METER_CACHE], sizeof(buffer)); RichString_appendAscii(out, CRT_colors[METER_TEXT], " cache:"); RichString_appendAscii(out, CRT_colors[SWAP_CACHE], buffer); } |