diff --git a/src/hanoi.erl b/src/hanoi.erl index 5259b2a..70ab835 100644 --- a/src/hanoi.erl +++ b/src/hanoi.erl @@ -222,6 +222,8 @@ open_levels(Dir) -> undefined, lists:seq(MaxLevel, MinLevel, -1)), + ok = hanoi_level:incremental_merge(TopLevel, 2*?BTREE_SIZE(MaxLevel)), + {ok, TopLevel}. parse_level(FileName) -> diff --git a/src/hanoi_level.erl b/src/hanoi_level.erl index a563e40..b214555 100644 --- a/src/hanoi_level.erl +++ b/src/hanoi_level.erl @@ -59,7 +59,6 @@ open(Dir,Level,Next) when Level>0 -> process_flag(trap_exit,true), initialize(#state{dir=Dir,level=Level,next=Next}) end), - incremental_merge(PID, 2*?BTREE_SIZE(?TOP_LEVEL)), {ok, PID}. lookup(Ref, Key) ->