Improved if & switch with constant conditions.