Skip to content

Instantly share code, notes, and snippets.

View aliegeni's full-sized avatar

Arvis aliegeni

View GitHub Profile
[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;