Improves code style and readability of 'graph' objects value insertion
This commit is contained in:
parent
0615e0a9e7
commit
b3d9032f04
@ -71,9 +71,11 @@ function loading.graph(display, x_pos, y_pos, width, var, arg, values)
|
||||
local value = tonumber(conky_parse(string.format("${%s %s}", var, arg)))
|
||||
|
||||
-- Sometimes, at startup, the first non-zero 'value' evaluates to a really huge number.
|
||||
-- See issue Conky#340 (https://github.com/brndnmtthws/conky/issues/340).
|
||||
-- See issue #340 (<https://github.com/brndnmtthws/conky/issues/340>).
|
||||
-- The following statement is here to avoid a huge line drawn on 'graph' objects...
|
||||
if math.abs(value) < 1.e+18 then table.insert(values, value) end
|
||||
if math.abs(value) < 1.e+18 then
|
||||
table.insert(values, value)
|
||||
end
|
||||
|
||||
return drawing.graph(display, x_pos, y_pos, width, values)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user