mirror of
https://github.com/nmap/nmap.git
synced 2026-01-28 17:19:05 +00:00
Cache a static table instead of regenerating every time
This commit is contained in:
@@ -408,6 +408,7 @@ function build_query(query)
|
||||
return table.concat(qstr, '&')
|
||||
end
|
||||
|
||||
local get_default_port_ports = {http=80, https=443}
|
||||
---
|
||||
-- Provides the default port for a given URI scheme.
|
||||
--
|
||||
@@ -416,8 +417,7 @@ end
|
||||
-- or nil in case of an undefined scheme
|
||||
-----------------------------------------------------------------------------
|
||||
function get_default_port (scheme)
|
||||
local ports = {http=80, https=443}
|
||||
return ports[(scheme or ""):lower()]
|
||||
return get_default_port_ports[(scheme or ""):lower()]
|
||||
end
|
||||
|
||||
if not unittest.testing() then
|
||||
|
||||
Reference in New Issue
Block a user