little speedup (hopefully)
This commit is contained in:
parent
9b440f279e
commit
bab8c2b629
@ -84,7 +84,7 @@ end
|
|||||||
|
|
||||||
local function parse_flat_table(str)
|
local function parse_flat_table(str)
|
||||||
if str:find("{%s*}") then return true, {} end
|
if str:find("{%s*}") then return true, {} end
|
||||||
str = str:gsub("^{(.-)[,;]?%s*}$", "%1,")
|
str = str:match("^{(.-)[,;]?%s*}$") .. ","
|
||||||
local next_index = 1
|
local next_index = 1
|
||||||
|
|
||||||
local res = {}
|
local res = {}
|
||||||
@ -92,7 +92,7 @@ local function parse_flat_table(str)
|
|||||||
local key, value, success
|
local key, value, success
|
||||||
if pair:find("=") then
|
if pair:find("=") then
|
||||||
key, value = pair:match("^(.-)=(.*)$")
|
key, value = pair:match("^(.-)=(.*)$")
|
||||||
key = key:gsub("^%s*(.-)%s*$", "%1")
|
key = key:match("^%s*(.-)%s*$")
|
||||||
success, key = parse_key(key)
|
success, key = parse_key(key)
|
||||||
if not success then return false, key end
|
if not success then return false, key end
|
||||||
else
|
else
|
||||||
@ -103,7 +103,7 @@ local function parse_flat_table(str)
|
|||||||
next_index = next_index + 1
|
next_index = next_index + 1
|
||||||
value = pair
|
value = pair
|
||||||
end
|
end
|
||||||
value = value:gsub("^%s*(.-)%s*$", "%1")
|
value = value:match("^%s*(.-)%s*$")
|
||||||
success, value = parse_value(value)
|
success, value = parse_value(value)
|
||||||
if not success then return false, value end
|
if not success then return false, value end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user