1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-22 06:09:01 +00:00
dmiller 1c0c090ace Refactor some Lua string concatenations.
Using this regular expression, '\(\w*\)\s*=\s*\1\s*\.\.', found and
replaced many string concatenation-reassignments. These can cause
performance issues, since a new string gets allocated for each
reassignment. In many cases, the replacement is simply a single string,
wrapped across lines with the '\z' escape, which consumes a newline and
whitespace following it. In other cases, a table is used to hold the
substrings until the final string is built with a single table.concat
operation (same technique used in stdnse.strbuf).

Also, some string-building loops of this form:

s = ""
for i = 1, 100, 1 do
  s = s .. "\0"
end

were replaced with this much faster and cleaner version:

s = string.rep("\0", 100)
2014-02-18 18:10:23 +00:00
2014-01-10 20:43:32 +00:00
2013-07-16 00:51:47 +00:00
2012-12-06 02:34:28 +00:00
2012-12-06 02:25:46 +00:00
2014-02-12 18:47:40 +00:00
2012-05-27 08:53:32 +00:00
2012-05-27 08:53:32 +00:00
2014-01-29 13:24:30 +00:00
2012-05-27 08:53:32 +00:00
2012-09-15 17:56:17 +00:00
2013-02-09 22:46:47 +00:00
2013-12-04 12:51:59 +00:00
2013-10-08 21:50:47 +00:00

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).
Languages
C 37.8%
Lua 28.1%
C++ 16.7%
Shell 5.8%
Python 4.2%
Other 7.1%