Skip to content

Commit

Permalink
Fix inequal comparison, resolve #22
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Jan 26, 2022
1 parent 8737d74 commit 7c64be4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function belongsToSubnet(host, list) {
var x = 0, y = list.length, middle;
while (y - x > 1) {
middle = Math.floor((x + y) / 2);
if (list[middle][0] < ip)
if (list[middle][0] <= ip)
x = middle;
else
y = middle;
Expand Down

0 comments on commit 7c64be4

Please sign in to comment.