Commits

Anonymous committed 13175c6

Better style

tags: az442

  • Participants
  • Parent commits 9fd6917

Comments (0)

Files changed (2)

File apps/riak_search/src/riak_search_client.erl

             Results1 = truncate_list(QueryStart, QueryRows, SortedResults),
             Length = length(SortedResults),
             {Length, Results1};
-        {error, Reason} ->
-            {error, Reason}
+        {error, _} = Err ->
+            Err
     end.
 
 %% Run the search query, fold results through function, return final
     case fold_results(SearchRef, Timeout, Fun, AccIn) of
         {ok, _NewSearchRef, AccOut} ->
             AccOut;
-        {error, Reason} ->
-            {error, Reason}
+        {error, _} = Err ->
+            Err
     end.
 
 search_doc(IndexOrSchema, QueryOps, QueryStart, QueryRows, Timeout) ->
     case collect_result(SearchRef, Timeout) of
         {done, Ref} ->
             {ok, Ref, Acc};
-        {error, Reason} ->
-            {error, Reason};
+        {error, _} = Err ->
+            Err;
         {Results, Ref} ->
             NewAcc = Fun(Results, Acc),
             fold_results(Ref, Timeout, Fun, NewAcc)
             {Results, SearchRef};
         {disconnect, Id} ->
             {[], SearchRef#riak_search_ref{inputcount=InputCount - 1}};
-        {error, Reason} ->
-            {error, Reason}
+        {error, _} = Err ->
+            Err
         after Timeout ->
              {error, timeout}
     end.

File apps/riak_search/src/riak_search_op_utils.erl

             OutputPid!{results, ResultVec2, OutputRef},
             gather_stream_results(Ref, OutputPid, OutputRef, TransformFun);
 
-        {Ref, {error, Reason}} ->
-            OutputPid ! {error, Reason};
+        {Ref, {error, _} = Err} ->
+            OutputPid ! Err;
 
         %% TODO: Check if this is dead code
         {Ref, {result, {DocID, Props}}} ->