|
@@ -55,11 +55,20 @@ next(_,_,_,_,_,T,N,C) when C == N -> T;
|
|
|
next(I,Key,S,{ok,A,X},_,T,N,C) -> next(I,Key,S,A,X,T,N,C);
|
|
|
next(_,___,_,{error,_},_,T,_,_) -> T;
|
|
|
next(I,Key,S,A,X,T,N,C) when size(A) > S ->
|
|
|
- case binary:part(A,0,S) of Key ->
|
|
|
- next(I,Key,S,rocksdb:iterator_move(I, next), [], [bt(X)|T],N,C+1);
|
|
|
- _ -> T end;
|
|
|
+ case binary:part(A, 0, S) of Key ->
|
|
|
+ next(I, Key, S, rocksdb:iterator_move(I, next), [], [bt(X)|T], N, C + 1);
|
|
|
+ _ -> T end;
|
|
|
next(_,_,_,_,_,T,_,_) -> T.
|
|
|
|
|
|
+prev(_,_,_,_,_,T,N,C) when C == N -> T;
|
|
|
+prev(I,Key,S,{ok,A,X},_,T,N,C) -> prev(I,Key,S,A,X,T,N,C);
|
|
|
+prev(_,___,_,{error,_},_,T,_,_) -> T;
|
|
|
+prev(I,Key,S,A,X,T,N,C) when size(A) > S ->
|
|
|
+ case binary:part(A, 0, S) of Key ->
|
|
|
+ prev(I, Key, S, rocksdb:iterator_move(I, prev), [], [bt(X)|T], N, C + 1);
|
|
|
+ _ -> T end;
|
|
|
+prev(_,_,_,_,_,T,_,_) -> T.
|
|
|
+
|
|
|
seq(_,_) ->
|
|
|
case os:type() of
|
|
|
{win32,nt} -> {Mega,Sec,Micro} = erlang:now(), integer_to_list((Mega*1000000+Sec)*1000000+Micro);
|