Minor bug in 'wait_valid()' #24

jonathn opened this Issue Mar 23, 2013 · 0 comments


None yet
2 participants

jonathn commented Mar 23, 2013

wait_valid(infinity, _Timeout) ->
wait_valid(StartTime, Timeout) ->
    Waited = timer:now_diff(os:timestamp(), StartTime),
    (Waited div 1000) < Timeout.

In the first line, I believe infinity should be matching the Timeout and not the StartTime.
Interestingly, this bug goes unnoticed because (Waited div 1000) < Timeout actually works as expected when Timeout is the atom infinity due to Erlang term sort-ordering rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment