Remove table.insert

This commit is contained in:
Kakarot
2021-10-25 06:47:40 -06:00
parent 570129bfd3
commit ed15db1df6
+5 -11
View File
@@ -3,15 +3,9 @@ QBShared = {}
local StringCharset = {} local StringCharset = {}
local NumberCharset = {} local NumberCharset = {}
for i = 48, 57 do for i = 48, 57 do NumberCharset[#NumberCharset+1] = string.char(i) end
table.insert(NumberCharset, string.char(i)) for i = 65, 90 do StringCharset[#StringCharset+1] = string.char(i) end
end for i = 97, 122 do StringCharset[#StringCharset+1] = string.char(i) end
for i = 65, 90 do
table.insert(StringCharset, string.char(i))
end
for i = 97, 122 do
table.insert(StringCharset, string.char(i))
end
QBShared.RandomStr = function(length) QBShared.RandomStr = function(length)
if length > 0 then if length > 0 then
@@ -34,11 +28,11 @@ QBShared.SplitStr = function(str, delimiter)
local from = 1 local from = 1
local delim_from, delim_to = string.find(str, delimiter, from) local delim_from, delim_to = string.find(str, delimiter, from)
while delim_from do while delim_from do
table.insert(result, string.sub(str, from, delim_from - 1)) result[#result+1] = string.sub(str, from, delim_from - 1)
from = delim_to + 1 from = delim_to + 1
delim_from, delim_to = string.find(str, delimiter, from) delim_from, delim_to = string.find(str, delimiter, from)
end end
table.insert(result, string.sub(str, from)) result[#result+1] = string.sub(str, from)
return result return result
end end