FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
97 stars 64 forks source link

`topological_sorting`: replace ineffective `continue` with `break` #229

Closed conpierce8 closed 10 months ago

conpierce8 commented 10 months ago

Description of issue

The continue statement in ufl.utils.sorting.topological_sorting (https://github.com/FEniCS/ufl/blob/main/ufl/utils/sorting.py#L25) has no effect: it causes execution to jump to the beginning of the inner for loop, which would happen anyway since there is no code following the continue inside the loop. It should be a break statement, since there is no need to continue searching the edges once node has been removed from S.

Description of changes

This pull request replaces the offending continue with a break.