applications/luci-statistics: avoid global vars, avoid nil indexing, get rid of counter variable
This commit is contained in:
parent
ad7aecad88
commit
bbc2c69965
1 changed files with 6 additions and 4 deletions
|
@ -196,10 +196,12 @@ end
|
||||||
function Instance.host_instances( self )
|
function Instance.host_instances( self )
|
||||||
local hosts_path = fs.glob(self._rrddir..'/*')
|
local hosts_path = fs.glob(self._rrddir..'/*')
|
||||||
local hosts = { }
|
local hosts = { }
|
||||||
k = 1
|
|
||||||
for v in hosts_path do
|
if hosts_path then
|
||||||
hosts[k] = fs.basename(v)
|
local path
|
||||||
k=k+1
|
for path in hosts_path do
|
||||||
|
hosts[#hosts+1] = fs.basename(path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return hosts
|
return hosts
|
||||||
|
|
Loading…
Reference in a new issue