Send step_done when merge ends also

… just to be nice, we'd get the {'DOWN', ...}
anyway
This commit is contained in:
Kresten Krab Thorup 2012-04-23 04:55:10 +02:00
parent 25b4099eec
commit a1c8bb40bd

View file

@ -133,11 +133,17 @@ scan(BT1, BT2, Out, IsLastLevel, [{Key1,Value1}|AT]=AKVs, [{Key2,Value2}|BT]=BKV
scan(BT1, BT2, Out2, IsLastLevel, AT, BT, Count+1, step(Step))
end.
scan_only(BT, Out, IsLastLevel, [], Count, Step) ->
scan_only(BT, Out, IsLastLevel, [], Count, {_, FromPID}=Step) ->
case hanoi_reader:next_node(BT) of
{node, KVs} ->
scan_only(BT, Out, IsLastLevel, KVs, Count, step(Step));
end_of_data ->
case FromPID of
none ->
ok;
{PID, Ref} ->
PID ! {Ref, step_done}
end,
{ok, Count, Out}
end;