diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-07 15:39:52 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-08-07 15:39:52 +0000 |
commit | adf1cc4c84cadd1b86ea15d171857c38bee7c967 (patch) | |
tree | a6eba6185a463472f7d82ce7d7a1fe866d4e586e | |
parent | 3546ed9bbe833fc6e0d1b4a73c0bbb4ea87b4ed0 (diff) |
* libs/core/ip: save a redundant object in compare()
-rw-r--r-- | libs/core/luasrc/ip.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua index a33c34964a..ea243f9507 100644 --- 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 |