mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 16:17:59 +00:00
Simplified object:method syntax for trim() and split()
This commit is contained in:
parent
fa079a1b3f
commit
c762937e74
@ -21,11 +21,11 @@ local wml_actions = wesnoth.wml_actions
|
||||
|
||||
local function trim(s)
|
||||
-- use (f(a)) to get first argument
|
||||
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
local function split(s)
|
||||
return string.gmatch(s, "[^%s,][^,]*")
|
||||
return s:gmatch("[^%s,][^,]*")
|
||||
end
|
||||
|
||||
local function optional_side_filter(cfg, key_name, filter_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user