From 79a2f95f6d35f278fd798e3011bc2275a4e3f4e4 Mon Sep 17 00:00:00 2001 From: Bill Freist Date: Wed, 6 Nov 2024 13:43:38 -0800 Subject: [PATCH] The for loop in removevalues should also break To match previous behavior, which was correct, the reverse iteration should also `break` so it doesn't needlessly try to match the entry that shifted into that index. No behavior change, as that entry would have already been checked and not matched. If the table only has one entry that is removed, this code would be indexing an empty table. --- src/base/bake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/bake.lua b/src/base/bake.lua index 07d04b53..221cb623 100644 --- a/src/base/bake.lua +++ b/src/base/bake.lua @@ -167,6 +167,7 @@ for _, pattern in ipairs(removes) do if pattern == tbl[i] then table.remove(tbl, i) + break end end end