mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Rename Meter.setValues() functions to updateValues()
Rationale (copied from htop issue #471): The function name "setValues" is misleading. For most OOP (object- oriented programming) contexts, setXXX functions mean they will change some member variables of an object into something specified in function arguments. But in the *Meter_setValues() case, the new values are not from the arguments, but from a hard-coded source. The caller is not supposed to change the values[] to anything it likes, but rather to "update" the values from the source. Hence, updateValues is a better name for this family of functions.
This commit is contained in:
@ -24,7 +24,7 @@ int MemoryMeter_attributes[] = {
|
||||
MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE
|
||||
};
|
||||
|
||||
static void MemoryMeter_setValues(Meter* this, char* buffer, int size) {
|
||||
static void MemoryMeter_updateValues(Meter* this, char* buffer, int size) {
|
||||
int written;
|
||||
Platform_setMemoryValues(this);
|
||||
|
||||
@ -60,7 +60,7 @@ MeterClass MemoryMeter_class = {
|
||||
.delete = Meter_delete,
|
||||
.display = MemoryMeter_display,
|
||||
},
|
||||
.setValues = MemoryMeter_setValues,
|
||||
.updateValues = MemoryMeter_updateValues,
|
||||
.defaultMode = BAR_METERMODE,
|
||||
.maxItems = 3,
|
||||
.total = 100.0,
|
||||
|
Reference in New Issue
Block a user