At least I don't think set() has any guarantees on order and it would be more robust against future changes that made xform_ids not ordered to explicitly inspect the case actions.