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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user