From 2f985d8576278d93a9da79a784d5d880f3e835bd Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Fri, 6 Jan 2012 00:02:29 +0100 Subject: [PATCH] Fix indentation --- src/fractal_btree_level.erl | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/fractal_btree_level.erl b/src/fractal_btree_level.erl index 55f18c1..fe7ba7b 100644 --- a/src/fractal_btree_level.erl +++ b/src/fractal_btree_level.erl @@ -128,28 +128,28 @@ main_loop(State = #state{ next=Next }) -> Parent = plain_fsm:info(parent), receive ?REQ(From, {lookup, Key})=Req -> - case do_lookup(Key, [State#state.b, State#state.a, Next]) of - notfound -> - reply(From, notfound); - {found, Result} -> - reply(From, {ok, Result}); - {delegate, DelegatePid} -> - DelegatePid ! Req - end, - main_loop(State); + case do_lookup(Key, [State#state.b, State#state.a, Next]) of + notfound -> + reply(From, notfound); + {found, Result} -> + reply(From, {ok, Result}); + {delegate, DelegatePid} -> + DelegatePid ! Req + end, + main_loop(State); ?REQ(From, {inject, FileName}) when State#state.b == undefined -> - if State#state.a == undefined -> - ToFileName = filename("A",State), - SetPos = #state.a; - true -> - ToFileName = filename("B",State), - SetPos = #state.b - end, - ok = file:rename(FileName, ToFileName), - {ok, BT} = fractal_btree_reader:open(ToFileName), - reply(From, ok), - check_begin_merge_then_loop(setelement(SetPos, State, BT)); + if State#state.a == undefined -> + ToFileName = filename("A",State), + SetPos = #state.a; + true -> + ToFileName = filename("B",State), + SetPos = #state.b + end, + ok = file:rename(FileName, ToFileName), + {ok, BT} = fractal_btree_reader:open(ToFileName), + reply(From, ok), + check_begin_merge_then_loop(setelement(SetPos, State, BT)); ?REQ(From, close) -> close_if_defined(State#state.a),