cpufreq: use string library for find/match

This commit is contained in:
Adrian C. (anrxc) 2009-10-04 00:55:56 +02:00
parent b4e028b21f
commit fcf1027cb5
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,8 @@ local function worker(format, cpuid)
-- Get the current voltage
local f = io.open("/sys/devices/system/cpu/"..cpuid.."/cpufreq/scaling_voltages")
if f then for line in f:lines() do
if line:find("^"..freq) then
voltage.mv = line:match("[%d]+[%s]([%d]+)")
if string.find(line, "^"..freq) then
voltage.mv = string.match(line, "[%d]+[%s]([%d]+)")
break
end
end