From 98cd592d7d0450203edcae1da876cfe444fec1a2 Mon Sep 17 00:00:00 2001 From: Brenton Farmer Date: Sun, 22 Sep 2024 12:55:08 -0700 Subject: [PATCH] normalization of code order --- src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs b/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs index 2be6518..29c8ad6 100644 --- a/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs +++ b/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs @@ -120,12 +120,10 @@ protected override Expression VisitSwitch( SwitchExpression node ) switchTransition.DefaultNode = _states[defaultIndex]; } - continueToIndex = PopContinueTo(); - - switchTransition.ContinueTo = _states[continueToIndex]; - _states[currentStateIndex].Transition = switchTransition; - _currentStateIndex = continueToIndex; + _currentStateIndex = PopContinueTo(); + + switchTransition.ContinueTo = _states[_currentStateIndex]; if ( _states[_currentStateIndex].Transition == null && _continueToIndexes.Count > 0 ) // BF: Feel like a bit of a hack. _states[_currentStateIndex].Transition = new GotoTransition { TargetNode = _states[_continueToIndexes.Peek()] };