Created
November 13, 2019 18:12
-
-
Save controlflow/4b749f34c35e240e03f7a8f33afe3a15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (myJumpStatement) | |
{ | |
case IReturnStatement returnStatement when returnStatement.Value != null: | |
ReplaceWithValue(returnStatement, returnStatement.Value); | |
break; | |
case IYieldStatement yieldStatement when yieldStatement.Expression != null: | |
ReplaceWithValue(yieldStatement, yieldStatement.Value); | |
break; | |
default: | |
myJumpStatement.RemoveOrReplaceByEmptyStatement(); | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (myJumpStatement) | |
{ | |
case IReturnStatement { Value: { } value } returnStatement: | |
ReplaceWithValue(returnStatement, value); | |
break; | |
case IYieldStatement { Expression: { } value } yieldStatement: | |
ReplaceWithValue(yieldStatement, value); | |
break; | |
default: | |
myJumpStatement.RemoveOrReplaceByEmptyStatement(); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment