1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

more efficient match, avoiding strings

This commit is contained in:
nnposter
2018-08-18 01:00:16 +00:00
parent 59efc272ec
commit 57a17415b7
2 changed files with 2 additions and 2 deletions

View File

@@ -370,7 +370,7 @@ function get_prefix_length( range )
last = ipOps.ip_to_bin(last)
for pos = 1, #first do
if first:sub(pos, pos) ~= last:sub(pos, pos) then
if first:byte(pos) ~= last:byte(pos) then
return pos - 1
end
end

View File

@@ -438,7 +438,7 @@ function get_prefix_length( range )
last = ipOps.ip_to_bin(last)
for pos = 1, #first do
if first:sub(pos, pos) ~= last:sub(pos, pos) then
if first:byte(pos) ~= last:byte(pos) then
return pos - 1
end
end