Move indirect computations behind seenItems

This commit is contained in:
DBotThePony 2022-11-13 00:01:01 +07:00
parent 9592860349
commit 6d97731614
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 6 additions and 30 deletions

View File

@ -28,18 +28,6 @@ fun addMatterData(provider: MatterDataProvider) {
Items.OXIDIZED_CUT_COPPER,
) to Items.CUT_COPPER,
listOf(
Items.EXPOSED_CUT_COPPER_SLAB,
Items.WEATHERED_CUT_COPPER_SLAB,
Items.OXIDIZED_CUT_COPPER_SLAB,
) to Items.CUT_COPPER_SLAB,
listOf(
Items.EXPOSED_CUT_COPPER_STAIRS,
Items.WEATHERED_CUT_COPPER_STAIRS,
Items.OXIDIZED_CUT_COPPER_STAIRS,
) to Items.CUT_COPPER_STAIRS,
listOf(
Items.WAXED_EXPOSED_COPPER,
Items.WAXED_WEATHERED_COPPER,
@ -51,18 +39,6 @@ fun addMatterData(provider: MatterDataProvider) {
Items.WAXED_WEATHERED_CUT_COPPER,
Items.WAXED_OXIDIZED_CUT_COPPER,
) to Items.WAXED_CUT_COPPER,
listOf(
Items.WAXED_EXPOSED_CUT_COPPER_SLAB,
Items.WAXED_WEATHERED_CUT_COPPER_SLAB,
Items.WAXED_OXIDIZED_CUT_COPPER_SLAB,
) to Items.WAXED_CUT_COPPER_SLAB,
listOf(
Items.WAXED_EXPOSED_CUT_COPPER_STAIRS,
Items.WAXED_WEATHERED_CUT_COPPER_STAIRS,
Items.WAXED_OXIDIZED_CUT_COPPER_STAIRS,
) to Items.WAXED_CUT_COPPER_STAIRS,
)
for ((children, parent) in copper) {

View File

@ -679,12 +679,6 @@ object MatterManager {
return Result(value2)
}
val value3 = Registry.indirect(item)
if (value3.value != null) {
return value3
}
if (item in seenItems) {
return Result.SKIPPED
}
@ -692,6 +686,12 @@ object MatterManager {
seenItems.addLast(item)
try {
val value3 = Registry.indirect(item)
if (value3.value != null) {
return value3
}
val result = doDetermineValue(item)
cachedIterationResults[item] = result
return result