Reduce branching by merging equivalent cases.