Skip to content

Instantly share code, notes, and snippets.

@aliegeni
Created January 24, 2013 12:18
Show Gist options
  • Save aliegeni/4620833 to your computer and use it in GitHub Desktop.
Save aliegeni/4620833 to your computer and use it in GitHub Desktop.
[Flags]
enum Tips { A = 1, B = 2 }
static Tips NoteiktTipu(Tips tips)
{
// Variants 1
return (tips & Tips.B) != 0 ? Tips.B : Tips.A;
//Variants 2
return tips == Tips.B ? Tips.B : Tips.A;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment