I have a huge list of checks that checks for example if integer is 4 or 10, if it is 4 it changes this int to 10 and Vice versa so my if check would be something like this:
int i = getval();
if (i == 4)
{
i = 10;
}
else if (i == 10)
{
i = 4;
}
My question is there another way to do this without the need to check for each condition.
If you have a huge list you might consider some list structure.
This works for huge lists of exchange pairs.
If you call AddExchangePair with a duplicate number e.g. (7,14) and (14, 16) you will get an exception. You might have to consider what to do in that case.