mirror of
https://github.com/nmap/nmap.git
synced 2026-02-08 22:46:34 +00:00
Minor optimization of url.parse_query()
This commit is contained in:
@@ -367,7 +367,7 @@ end
|
||||
-----------------------------------------------------------------------------
|
||||
function parse_query(query)
|
||||
local parsed = {}
|
||||
local pos = 0
|
||||
local pos = 1
|
||||
|
||||
query = string.gsub(query, "&", "&")
|
||||
query = string.gsub(query, "<", "<")
|
||||
@@ -383,7 +383,7 @@ function parse_query(query)
|
||||
end
|
||||
|
||||
while true do
|
||||
local first, last = string.find(query, "&", pos)
|
||||
local first, last = string.find(query, "&", pos, true)
|
||||
if first then
|
||||
ginsert(string.sub(query, pos, first-1));
|
||||
pos = last+1
|
||||
|
||||
Reference in New Issue
Block a user