You can reorganize your data so that you set a value prior to the switch and only modify it when necessary (and possible).
Eg:
selectedCase=true;
You can put that outside the switch and only modify it in the switch when
selectedCase=false;
Remove anything in your switch (loop, whatever) that either remains unchanged, as well. Tell the computer just once!