Skip to content

Instantly share code, notes, and snippets.

@plioi
Created December 29, 2011 02:53
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 plioi/1531404 to your computer and use it in GitHub Desktop.
Save plioi/1531404 to your computer and use it in GitHub Desktop.
public static int DoSomething(int x, int y)
{
if (x > 0)
return x;
return y;
}
public static int DoSomethingLazily(Func<int> x, Func<int> y)
{
var xValue = x();
if (xValue > 0)
return xValue;
return y();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment