Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created June 29, 2020 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save controlflow/d7c1a28df211e5d6aa618ea8a2b3eeb9 to your computer and use it in GitHub Desktop.
Save controlflow/d7c1a28df211e5d6aa618ea8a2b3eeb9 to your computer and use it in GitHub Desktop.
if (arguments[currentIndex].MatchingParameter?.Element.IndexOf() is {} index && index >= 0)
// vs.
if (arguments[currentIndex].MatchingParameter?.Element.IndexOf() is >= 0 and var index)
var argumentsMax = TryGetMethodArgumentAbstractValues();
if (argumentsMax == null) return null;
if (argumentsMax.Count != 2) return null;
// vs
var argumentsMax = TryGetMethodArgumentAbstractValues();
if (argumentsMax is null or { Count: not 2 }) return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment