From 72513b350acd1f8155ba151497b4fc65bbf33660 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Fri, 23 Jul 2021 10:46:23 -0700 Subject: [PATCH] revert to fsplit --- worldeditadditions/utils/strings/split.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/worldeditadditions/utils/strings/split.lua b/worldeditadditions/utils/strings/split.lua index 3b5a994..73af851 100644 --- a/worldeditadditions/utils/strings/split.lua +++ b/worldeditadditions/utils/strings/split.lua @@ -48,13 +48,13 @@ end -- @param plain boolean If true (or truthy), pattern is interpreted as a -- plain string, not a Lua pattern -- @returns table A sequence table containing the substrings --- function worldeditadditions.split(text, pattern, plain) --- local ret = {} --- for match in worldeditadditions.gsplit(text, pattern, plain) do --- table.insert(ret, match) --- end --- return ret --- end +function worldeditadditions.split(text, pattern, plain) + local ret = {} + for match in worldeditadditions.gsplit(text, pattern, plain) do + table.insert(ret, match) + end + return ret +end --- Split a string into substrings separated by a pattern. -- @param str string The string to iterate over @@ -62,7 +62,7 @@ end -- @param plain boolean If true (or truthy), pattern is interpreted as a -- plain string, not a Lua pattern -- @returns table A sequence table containing the substrings -function worldeditadditions.split (str,dlm,plain) +function worldeditadditions.fsplit (str,dlm,plain) local pos, ins = 0, 0 local ret = {} repeat