From c9a16cca84d8eac2cc87e91ca01f88ac05cea0f8 Mon Sep 17 00:00:00 2001 From: Victor Luchits Date: Mon, 27 May 2024 16:37:59 +0300 Subject: [PATCH] Ooops --- defaults.go | 1 - pack_data.go | 2 -- select.go | 3 ++- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/defaults.go b/defaults.go index f562801..c35b7c3 100644 --- a/defaults.go +++ b/defaults.go @@ -4,7 +4,6 @@ import "time" const ( DefaultIndex = "primary" - ) var ( diff --git a/pack_data.go b/pack_data.go index 6101d49..df0c8df 100644 --- a/pack_data.go +++ b/pack_data.go @@ -13,7 +13,6 @@ type packData struct { packedDefaultSpace []byte packedDefaultIndex []byte packedIterEq []byte - packedDefaultLimit []byte packedDefaultOffset []byte packedSingleKey []byte spaceMap map[string]uint64 @@ -52,7 +51,6 @@ func newPackData(defaultSpace interface{}) *packData { packedDefaultSpace: packedDefaultSpace, packedDefaultIndex: encodeValues2(KeyIndexNo, uint32(0)), packedIterEq: encodeValues2(KeyIterator, IterEq), - packedDefaultLimit: encodeValues2(KeyLimit, DefaultLimit), packedDefaultOffset: encodeValues2(KeyOffset, 0), packedSingleKey: packSelectSingleKey(), spaceMap: make(map[string]uint64), diff --git a/select.go b/select.go index c603f36..d6ad080 100644 --- a/select.go +++ b/select.go @@ -42,7 +42,8 @@ func (q *Select) packMsg(data *packData, b []byte) (o []byte, err error) { } if q.Limit == 0 { - o = append(o, data.packedDefaultLimit...) + o = msgp.AppendUint(o, KeyLimit) + o = msgp.AppendUint(o, uint(DefaultLimit)) } else { o = msgp.AppendUint(o, KeyLimit) o = msgp.AppendUint(o, uint(q.Limit))