projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Second try...
[project/luci.git]
/
applications
/
luci-olsr
/
luasrc
/
controller
/
olsr.lua
diff --git
a/applications/luci-olsr/luasrc/controller/olsr.lua
b/applications/luci-olsr/luasrc/controller/olsr.lua
index
d478df0
..
577f596
100644
(file)
--- a/
applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/
applications/luci-olsr/luasrc/controller/olsr.lua
@@
-45,15
+45,18
@@
function action_index()
end
local function compare(a, b)
end
local function compare(a, b)
- if tonumber(a.ETX) == 0 then
+ local c = tonumber(a.ETX)
+ local d = tonumber(b.ETX)
+
+ if not c or c == 0 then
return false
end
return false
end
- if
tonumber(b.ETX)
== 0 then
+ if
not d or d
== 0 then
return true
end
return true
end
- return
tonumber(a.ETX) < tonumber(b.ETX)
+ return
c < d
end
table.sort(data.Links, compare)
end
table.sort(data.Links, compare)
@@
-70,15
+73,18
@@
function action_routes()
end
local function compare(a, b)
end
local function compare(a, b)
- if tonumber(a.ETX) == 0 then
+ local c = tonumber(a.ETX)
+ local d = tonumber(b.ETX)
+
+ if not c or c == 0 then
return false
end
return false
end
- if
tonumber(b.ETX)
== 0 then
+ if
not d or d
== 0 then
return true
end
return true
end
- return
tonumber(a.ETX) < tonumber(b.ETX)
+ return
c < d
end
table.sort(data.Routes, compare)
end
table.sort(data.Routes, compare)