Prune unreachbale branches

This commit is contained in:
martinsumner 2016-11-04 19:14:03 +00:00
parent a251f3eab0
commit 2299e1ce9d
2 changed files with 6 additions and 20 deletions

View file

@ -129,9 +129,7 @@ handle_call({manifest_change, confirm, Closing}, From, State) ->
{noreply, {noreply,
State#state{work_item=null, change_pending=false}, State#state{work_item=null, change_pending=false},
?MIN_TIMEOUT} ?MIN_TIMEOUT}
end; end.
handle_call(close, _From, State) ->
{stop, normal, ok, State}.
handle_cast(prompt, State) -> handle_cast(prompt, State) ->
{noreply, State, ?MIN_TIMEOUT}. {noreply, State, ?MIN_TIMEOUT}.

View file

@ -362,14 +362,12 @@ handle_cast(close, State) ->
{stop, normal, State}. {stop, normal, State}.
handle_info(timeout, State) -> handle_info(timeout, State) ->
case State#state.ready_for_delete of if
true -> State#state.ready_for_delete == true ->
leveled_log:log("SFT05", [timeout, State#state.filename]), leveled_log:log("SFT05", [timeout, State#state.filename]),
ok = leveled_penciller:pcl_confirmdelete(State#state.penciller, ok = leveled_penciller:pcl_confirmdelete(State#state.penciller,
State#state.filename), State#state.filename),
{noreply, State, ?DELETE_TIMEOUT}; {noreply, State, ?DELETE_TIMEOUT}
false ->
{noreply, State}
end. end.
terminate(Reason, State) -> terminate(Reason, State) ->
@ -378,19 +376,9 @@ terminate(Reason, State) ->
true -> true ->
leveled_log:log("SFT06", [State#state.filename]), leveled_log:log("SFT06", [State#state.filename]),
ok = file:close(State#state.handle), ok = file:close(State#state.handle),
ok = case filelib:is_file(State#state.filename) of ok = file:delete(State#state.filename);
true ->
file:delete(State#state.filename);
false ->
ok
end;
_ -> _ ->
case State#state.handle of ok = file:close(Handle)
undefined ->
ok;
Handle ->
file:close(Handle)
end
end. end.
code_change(_OldVsn, State, _Extra) -> code_change(_OldVsn, State, _Extra) ->