From cd4b04df44023f9c81885978522f337763dcf7a9 Mon Sep 17 00:00:00 2001 From: "J. Thalheim" Date: Sat, 19 Nov 2011 02:24:34 +0100 Subject: thermal: remove unnecessary read --- widgets/thermal.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/thermal.lua b/widgets/thermal.lua index 4d837c8..1906568 100644 --- a/widgets/thermal.lua +++ b/widgets/thermal.lua @@ -30,11 +30,12 @@ local function worker(format, warg) -- Get temperature from thermal zone local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) - if thermal[zone[warg[2]].file] then + local data = thermal[zone[warg[2]].file] + if data then if zone[warg[2]].div then - return {thermal[zone[warg[2]].file] / zone[warg[2]].div} + return {data / zone[warg[2]].div} else -- /proc/acpi "temperature: N C" - return {tonumber(string.match(thermal[zone[warg[2]].file], "[%d]+"))} + return {tonumber(string.match(data, "[%d]+"))} end end -- cgit v1.2.3