From 1fb7e7ae778f0eabdb0c3d3b0303e4339622c219 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Tue, 17 Jan 2023 14:42:47 +0700 Subject: [PATCH] simplify cursor2stream --- kv/mdbx/kv_mdbx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kv/mdbx/kv_mdbx.go b/kv/mdbx/kv_mdbx.go index e13c13bf6..051959e56 100644 --- a/kv/mdbx/kv_mdbx.go +++ b/kv/mdbx/kv_mdbx.go @@ -1782,14 +1782,14 @@ func (s *cursor2stream) HasNext() bool { cmp := bytes.Compare(s.nextK, s.toPrefix) return (s.orderAscend && cmp < 0) || (!s.orderAscend && cmp > 0) } -func (s *cursor2stream) Next() ([]byte, []byte, error) { +func (s *cursor2stream) Next() (k, v []byte, err error) { select { case <-s.ctx.Done(): return nil, nil, s.ctx.Err() default: } s.limit-- - k, v, err := s.nextK, s.nextV, s.nextErr + k, v, err = s.nextK, s.nextV, s.nextErr if s.orderAscend { s.nextK, s.nextV, s.nextErr = s.c.Next() } else {