Created
October 26, 2016 00:04
-
-
Save controlflow/40c0be27538be0083b3b63c1dd48170e 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
using System; | |
interface ITreeNode { } | |
interface IScope { } | |
class C | |
{ | |
public bool InteriorShouldBeProcessed(ITreeNode element) | |
{ | |
return !(element is IScope) || ScopeShouldBeVisited((IScope) element); | |
} | |
public bool InteriorShouldBeProcessed2(ITreeNode element) | |
{ | |
return !(element is IScope s) || ScopeShouldBeVisited(s); | |
} | |
public bool InteriorShouldBeProcessed3(ITreeNode element) | |
{ | |
return !(element is IScope s && !ScopeShouldBeVisited(s)); | |
} | |
public bool ScopeShouldBeVisited(IScope s) => true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment