Skip to content

Commit

Permalink
Fix a few small issues in pqueue3.
Browse files Browse the repository at this point in the history
  • Loading branch information
okeuday committed Nov 14, 2011
1 parent 889efd6 commit 29b9f8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pqueue3.erl
Expand Up @@ -62,6 +62,7 @@
is_queue/1, % O(1)
len/1, % O(N)
new/0, % O(1)
new/1, % O(1)
out/1, % O(1) amortized, O(N) worst case
out/2, % O(1) amortized, O(N) worst case
pout/1, % O(1) amortized, O(N) worst case
Expand Down Expand Up @@ -186,7 +187,7 @@ new(Options) ->
MiddleZero = proplists:get_value(middle_priority_zero, Options, true),
Offset = if
MiddleZero =:= true ->
erlang:trunc((Size / 2) - 1);
erlang:round((Size / 2) + 0.5) - 1;
true ->
0
end,
Expand Down Expand Up @@ -274,7 +275,6 @@ create([I | Is]) ->
erlang:make_tuple(I + 1, create(Is)).

in_queue({I1}, Value, Bins1) ->
io:format("~p~n", [erlang:element(I1, Bins1)]),
erlang:setelement(I1, Bins1, queue:in(Value, erlang:element(I1, Bins1)));

in_queue({I1, I2}, Value, Bins1) ->
Expand Down

0 comments on commit 29b9f8d

Please sign in to comment.