reduce garbage creation and fix channel spell range checks

This commit is contained in:
Jrc13245
2025-12-20 13:46:06 -05:00
parent 58431b1967
commit d8b4a097b3
4 changed files with 155 additions and 158 deletions
+3 -6
View File
@@ -409,12 +409,9 @@ function CleveRoids.splitStringIgnoringQuotes(str, separator)
local cacheKey = str .. "|" .. sepKey
local cached = _splitCache[cacheKey]
if cached then
-- Return a copy to prevent mutation issues
local copy = getSplitResult()
for i = 1, table.getn(cached) do
copy[i] = cached[i]
end
return copy
-- PERFORMANCE: Return cached result directly - callers should only iterate, not mutate
-- This avoids table allocation on every cache hit
return cached
end
local result = getSplitResult()