In C#, instead of doing if(index == 7 || index == 8), is there a way to combine them? I\'m thinking of something like if(index == (7, 8)).
if(index == 7 || index == 8)
if(index == (7, 8))
switch (GetExpensiveValue()) { case 7: case 8: // do work break; }
This obviously takes more code, but it may save you from evaluating a function a bunch of times.