1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Clean up string concatenations

Building a string with var = var .. "something" has miserable time
complexities. This commit cleans up a lot of that in scripts, focusing
on packing of data with bin.pack and concatenations within loops.
Additionally, a few instances were replaced with string.rep
This commit is contained in:
dmiller
2015-02-25 19:58:42 +00:00
parent ddb3905b20
commit 10dce0382c
26 changed files with 174 additions and 205 deletions

View File

@@ -271,11 +271,7 @@ function action(host, port)
-- Show what patterns matched what files
for name, matches in pairs(info["interesting-matches"] or {}) do
local temp = name .. " matched patterns"
for _, matched in ipairs(matches) do
temp = temp .. " '" .. matched .. "'"
end
table.insert(new, temp)
table.insert(new, ("%s matched patterns '%s'"):format(name, table.concat(matches, "' '")))
end
if info["repository-description"] then