mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
fix: early abort if ip matches
This commit is contained in:
1 parent
655bb41f59
commit
6141145fbe
1 file changed
+2
-1
+2
-1
@@ -69,6 +69,8 @@ def get_coords(ips: "Path", ip: str) -> Coords:
|
|||||||
upper = fields[1]
|
upper = fields[1]
|
||||||
|
|
||||||
upper_digits = ip2list(upper)
|
upper_digits = ip2list(upper)
|
||||||
|
if ip == upper:
|
||||||
|
return Coords(float(fields[-2]), float(fields[-1]))
|
||||||
|
|
||||||
if split[2] > upper_digits[2]:
|
if split[2] > upper_digits[2]:
|
||||||
continue
|
continue
|
||||||
@@ -76,7 +78,6 @@ def get_coords(ips: "Path", ip: str) -> Coords:
|
|||||||
if split[2] == upper_digits[2]:
|
if split[2] == upper_digits[2]:
|
||||||
if split[3] > upper_digits[3]:
|
if split[3] > upper_digits[3]:
|
||||||
continue
|
continue
|
||||||
# TODO: handle last digit equals
|
|
||||||
|
|
||||||
if split[2] <= upper_digits[2]:
|
if split[2] <= upper_digits[2]:
|
||||||
return Coords(float(fields[-2]), float(fields[-1]))
|
return Coords(float(fields[-2]), float(fields[-1]))
|
||||||
|
|||||||
Reference in new issue
Block a user