pp_iter: replace if/else with switch