From e7f447b6a3473a572d3e6c191128f1796477860d Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 4 Apr 2023 16:24:37 +1000 Subject: Refactor and consolidate dynamic meters/columns pointers This removes the duplication of dynamic meter/column hashtable pointers that has come in between the Settings and ProcessList structures - only one copy of these is needed. With the future planned dynamic screens feature adding another pointer, let us first clean this up before any further duplication happens. --- DynamicMeter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'DynamicMeter.c') diff --git a/DynamicMeter.c b/DynamicMeter.c index a8cd76cc..40c06bb6 100644 --- a/DynamicMeter.c +++ b/DynamicMeter.c @@ -88,16 +88,16 @@ static void DynamicMeter_display(const Object* cast, RichString* out) { } static const char* DynamicMeter_getCaption(const Meter* this) { - const ProcessList* pl = this->pl; - const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param); + const Settings* settings = this->pl->settings; + const DynamicMeter* meter = Hashtable_get(settings->dynamicMeters, this->param); if (meter) return meter->caption ? meter->caption : meter->name; return this->caption; } static void DynamicMeter_getUiName(const Meter* this, char* name, size_t length) { - const ProcessList* pl = this->pl; - const DynamicMeter* meter = Hashtable_get(pl->dynamicMeters, this->param); + const Settings* settings = this->pl->settings; + const DynamicMeter* meter = Hashtable_get(settings->dynamicMeters, this->param); if (meter) { const char* uiName = meter->caption; if (uiName) { -- cgit v1.2.3