mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
fixd bug, the left side was lost. thanks for mmy83@git.oschina.net.
This commit is contained in:
parent
ac134ac0b9
commit
9152488163
@ -41,7 +41,7 @@ class Ip2Region(object):
|
||||
sip = self.getLong(b, 0)
|
||||
eip = self.getLong(b, 4)
|
||||
|
||||
if ip > sip:
|
||||
if ip >= sip:
|
||||
if ip > eip:
|
||||
l = m + 1
|
||||
else:
|
||||
@ -118,7 +118,7 @@ class Ip2Region(object):
|
||||
m = int((l+h)/2)
|
||||
offset = m * 12
|
||||
|
||||
if ip > self.getLong(b, offset):
|
||||
if ip >= self.getLong(b, offset):
|
||||
if ip > self.getLong(b, offset+4):
|
||||
l = m + 1
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user