1
0
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:
dmiller
2018-08-11 21:23:59 +00:00
parent b2deb019ed
commit 0e2683e079

View File

@@ -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