git.99rst.org
/
openwrt-luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
ad7aeca
)
applications/luci-statistics: avoid global vars, avoid nil indexing, get rid of count...
author
Jo-Philipp Wich
<redacted>
Sun, 19 Feb 2012 17:05:09 +0000
(17:05 +0000)
committer
Jo-Philipp Wich
<redacted>
Sun, 19 Feb 2012 17:05:09 +0000
(17:05 +0000)
applications/luci-statistics/luasrc/statistics/datatree.lua
patch
|
blob
|
history
diff --git
a/applications/luci-statistics/luasrc/statistics/datatree.lua
b/applications/luci-statistics/luasrc/statistics/datatree.lua
index d6de6fa2178b08a15d526d41db6f81f31a2bfcb0..850b83a998c9bf33b53c0eca89c4cfadb0ef0b9e 100644
(file)
--- a/
applications/luci-statistics/luasrc/statistics/datatree.lua
+++ b/
applications/luci-statistics/luasrc/statistics/datatree.lua
@@
-196,10
+196,12
@@
end
function Instance.host_instances( self )
local hosts_path = fs.glob(self._rrddir..'/*')
local hosts = { }
- k = 1
- for v in hosts_path do
- hosts[k] = fs.basename(v)
- k=k+1
+
+ if hosts_path then
+ local path
+ for path in hosts_path do
+ hosts[#hosts+1] = fs.basename(path)
+ end
end
return hosts
git clone https://git.99rst.org/PROJECT