Skip to content

Commit 4fd9ca4

Browse files
premature optimization
1 parent 93b1c40 commit 4fd9ca4

File tree

1 file changed

+2
-1
lines changed
  • Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm

1 file changed

+2
-1
lines changed

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/CastingVM.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class CastingVM(var image: CastingImage, val env: CastingEnvironment) {
4141
@JvmOverloads
4242
fun queueExecuteAndWrapIotas(iotas: List<Iota>, world: ServerLevel, nextContinuation: SpellContinuation = SpellContinuation.Done): ExecutionClientView {
4343
// Initialize the continuation stack to a single top-level eval for all iotas.
44-
var continuation = nextContinuation.pushFrame(FrameEvaluate(SpellList.LList(0, iotas), false))
44+
// HACK: Ideally, we'd have a separate (SpellContinuation, ServerWorld) overload, but then 0.11.3 would cause mixins to break. Look into properly splitting this in 1.21?
45+
var continuation = if (iotas.isNotEmpty()) nextContinuation.pushFrame(FrameEvaluate(SpellList.LList(0, iotas), false)) else nextContinuation;
4546
// Begin aggregating info
4647
val info = TempControllerInfo(earlyExit = false)
4748
var lastResolutionType = ResolvedPatternType.UNRESOLVED

0 commit comments

Comments
 (0)