mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Strenghten asc and rev functions
This commit is contained in:
parent
04a6c61709
commit
902941fc92
1 changed files with 12 additions and 4 deletions
|
|
@ -263,17 +263,25 @@ end
|
|||
-- ##############################################
|
||||
|
||||
function asc(a,b)
|
||||
return (a < b)
|
||||
if a == nil or b == nil then
|
||||
return false
|
||||
elseif type(a) ~= type(b) then
|
||||
traceError(TRACE_WARNING, TRACE_CONSOLE, "Bad types in asc(): " .. a .. " (".. type(a) ..") vs " .. b .. " (".. type(b) .. ")")
|
||||
end
|
||||
|
||||
return (a < b)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function rev(a,b)
|
||||
if((a == nil) or (b == nil)) then
|
||||
if a == nil or b == nil then
|
||||
return false
|
||||
else
|
||||
return (a > b)
|
||||
elseif type(a) ~= type(b) then
|
||||
traceError(TRACE_WARNING, TRACE_CONSOLE, "Bad types in rev(): " .. a .. " (".. type(a) ..") vs " .. b .. " (".. type(b) .. ")")
|
||||
end
|
||||
|
||||
return (a > b)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue