sort_in_topological_order(): avoid setting a commit flag