Skip to content

Commit

Permalink
Remove redundant stdlib calls
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Jun 29, 2024
1 parent 8a2c988 commit a79f685
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,14 @@ if settings.startup['rpm_entity'].value ~= 30 or settings.startup['rpm_items'].v
})

for _, recipe in pairs(data.raw.recipe) do
for _, result_table in pairs {
recipe.result and {recipe.result},
recipe.results,
recipe.normal and (recipe.normal.results or {recipe.normal.result}),
recipe.expensive and (recipe.expensive.results or {recipe.expensive.result})
} do
for _, result in pairs(result_table) do -- This looks long, however we skip a lot of the logic with caching
local result_name = result[1] or result.name
if result_name and valid_entities[result_name] then
--log("Set multiplier for " .. recipe.name .. " (" .. result_name .. ")")
recipe.requester_paste_multiplier = settings.startup['rpm_entity'].value
recipe.overload_multiplier = settings.startup['overload'].value
goto continue
end
recipe:standardize()
for _, result in pairs(recipe.results) do -- This looks long, however we skip a lot of the logic with caching
local result_name = result.name
if result_name and valid_entities[result_name] then
--log("Set multiplier for " .. recipe.name .. " (" .. result_name .. ")")
recipe.requester_paste_multiplier = settings.startup['rpm_entity'].value
recipe.overload_multiplier = settings.startup['overload'].value
goto continue
end
end
recipe.requester_paste_multiplier = settings.startup['rpm_items'].value
Expand All @@ -74,4 +68,4 @@ for _, recipe in pairs(data.raw.recipe) do
if recipe.category == 'tar' and not recipe.crafting_machine_tint then
error('Recipe ' .. recipe.name .. ' is missing crafting_machine_tint. Please fill out this field.')
end
end
end

0 comments on commit a79f685

Please sign in to comment.