Last active
August 15, 2017 01:36
-
-
Save controlflow/076d74cdc25c07a630e756844d497829 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
var unaryExpression = selector.Body as UnaryExpression; | |
var binaryExpression = unaryExpression == null ? null : unaryExpression.Operand as BinaryExpression; | |
// vs. | |
var unaryExpression = selector.Body as UnaryExpression; | |
var binaryExpression = unaryExpression?.Operand as BinaryExpression; | |
// vs. | |
var binaryExpression = !(selector.Body is UnaryExpression unaryExpression) ? null : unaryExpression.Operand as BinaryExpression; | |
var binaryExpression = selector.Body is UnaryExpression unaryExpression ? unaryExpression.Operand as BinaryExpression : null; | |
// vs. | |
var binaryExpression = (selector.Body as UnaryExpression)?.Operand as BinaryExpression; |
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
var unaryExpression = selector.Body as UnaryExpression; | |
// vs. | |
var binaryExpression = selector.Body is UnaryExpression unaryExpression ? unaryExpression : null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment