• Vincent Pelletier's avatar
    ERP5Catalog: Assorted simplifications. · e5b4f73b
    Vincent Pelletier authored
    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.
    e5b4f73b
CatalogTool.py 57.4 KB