diff --git a/src/connection/mc_cursor.erl b/src/connection/mc_cursor.erl index 38e5ec01..2555e9da 100644 --- a/src/connection/mc_cursor.erl +++ b/src/connection/mc_cursor.erl @@ -129,22 +129,22 @@ init([Owner, Connection, Collection, Cursor, BatchSize, Batch]) -> %% @hidden handle_call({next, Timeout}, _From, State) -> case next_i(State, Timeout) of - {Reply, #state{cursor = 0, batch = []} = UpdatedState} -> - {stop, normal, Reply, UpdatedState}; + {{}, UpdatedState} -> + {stop, normal, {}, UpdatedState}; {Reply, UpdatedState} -> {reply, Reply, UpdatedState} end; handle_call({rest, Limit, Timeout}, _From, State) -> case rest_i(State, Limit, Timeout) of - {Reply, #state{cursor = 0} = UpdatedState} -> - {stop, normal, Reply, UpdatedState}; + {{}, UpdatedState} -> + {stop, normal, {}, UpdatedState}; {Reply, UpdatedState} -> {reply, Reply, UpdatedState} end; handle_call({next_batch, Timeout}, _From, State = #state{batchsize = Limit}) -> case rest_i(State, Limit, Timeout) of - {Reply, #state{cursor = 0} = UpdatedState} -> - {stop, normal, Reply, UpdatedState}; + {{}, UpdatedState} -> + {stop, normal, {}, UpdatedState}; {Reply, UpdatedState} -> {reply, Reply, UpdatedState} end.