Skip to content

Commit

Permalink
when blocked, stop quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jan 10, 2020
1 parent 75538c0 commit 90043dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Wave.elm
Expand Up @@ -153,7 +153,7 @@ propagate :
-> Wave comparable
-> Wave comparable
propagate todo (Wave wave) =
case todo of
case Debug.log "todo" todo of
[] ->
-- stack empty, we're done
Wave wave
Expand Down Expand Up @@ -223,7 +223,11 @@ propagateInDirection source cell direction ( Wave wave, todo ) =
wave.entropy
}
, -- TODO: add this as a target for propagation if it's not already in this list -
if not (List.member target todo) then
if Set.isEmpty reduced then
-- we're blocked and should stop immediately
[]

else if not (List.member target todo) then
target :: todo

else
Expand Down

0 comments on commit 90043dc

Please sign in to comment.