Skip to content

Commit

Permalink
fix: nil table in split func
Browse files Browse the repository at this point in the history
  • Loading branch information
TorchedSammy committed Oct 17, 2021
1 parent 796e8de commit 9784133
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ string.split = function(str, delimiter)
local delimFrom, delimTo = string.find(str, delimiter, from)

while delimFrom do
table.insert(result, string.sub(str, from, delimFrom - 1))
table.insert(res, string.sub(str, from, delimFrom - 1))
from = delimTo + 1
delimFrom, delimTo = string.find(str, delimiter, from)
end

table.insert(result, string.sub(str, from))
table.insert(res, string.sub(str, from))

return res
end
Expand Down

0 comments on commit 9784133

Please sign in to comment.