projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3546ed9
)
* libs/core/ip: save a redundant object in compare()
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 7 Aug 2008 15:39:52 +0000
(15:39 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 7 Aug 2008 15:39:52 +0000
(15:39 +0000)
libs/core/luasrc/ip.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/ip.lua
b/libs/core/luasrc/ip.lua
index a33c34964a473da431b650176cd6eeb5388fc67d..ea243f9507e434d6e8b6b1e5cd0b2eac30756956 100644
(file)
--- a/
libs/core/luasrc/ip.lua
+++ b/
libs/core/luasrc/ip.lua
@@
-321,8
+321,10
@@
function cidr.mask( self, bits )
end
function cidr.contains( self, addr )
- if self:mask() <= addr:mask() then
- return self:mask(addr:prefix()) == addr:mask()
+ local mask1 = self:mask()
+ local mask2 = addr:mask()
+ if mask1 <= mask2 then
+ return self:mask(addr:prefix()) == mask2
end
return false