ERP5Catalog: Assorted simplifications.
Test loop invariant outside of loop. Use clearer and more consistent variable names. Avoid iterating twice when once is enough, allowing removal of "local_role_dict" local and simplification of corresponding dict structure. Avoid creating new instances when the existing one can be mutated. Evaluate dict as boolean instead of constructing an empty dict to compare against. Avoid using %-operator just to concatenate strings (allows en-passant typechecking). Drop unused locals. Do not use a dict when a set would be sufficient.
Showing
Please register or sign in to comment