Created
March 27, 2017 12:10
-
-
Save controlflow/bb51c6b251542dead945ad1fc947c49c 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
while (ReferenceNameNavigator.GetByQualifier(referenceName) != null) | |
referenceName = ReferenceNameNavigator.GetByQualifier(referenceName); |
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
while (ReferenceNameNavigator.GetByQualifier(referenceName) is var byQualifier && byQualifier != null) | |
referenceName = byQualifier; |
"Less-scoped" is nice; the minimalist aesthetic should be more widely celebrated.
In this vein, why not just eliminate the excess variable entirely?
while (referenceName != (referenceName = ReferenceNameNavigator.GetByQualifier(referenceName) ?? referenceName))
;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ViIvanov yep, and with a less-scoped variable