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