CatalogTool: Assorted readability improvements.
Fix a misnamed local. Use iteritems. Move variables next to the loop they act on. Rewrite comments to better reflect the intention when it is not obvious in the implementation. Move a loop-invariant out of loop ((user, role) not in optimized_role_set). Do not use set.update on an iterable constructed just for the call, call set.add on each item.
Showing with 17 additions and 17 deletions