From d053fc0956441e297e62a28f98632ef00e257b2f Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Mon, 11 Sep 2023 14:07:58 +0300 Subject: [PATCH] refactor: orm/encoding/encodeutil: remove impossible len overflow check (#17643) --- orm/encoding/encodeutil/util.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/orm/encoding/encodeutil/util.go b/orm/encoding/encodeutil/util.go index 0d84093803..fb89bb81e2 100644 --- a/orm/encoding/encodeutil/util.go +++ b/orm/encoding/encodeutil/util.go @@ -13,13 +13,10 @@ import ( // This is used for efficient logical decoding of keys. func SkipPrefix(r *bytes.Reader, prefix []byte) error { n := len(prefix) - if n > 0 { - // we skip checking the prefix for performance reasons because we assume - // that it was checked by the caller - _, err := r.Seek(int64(n), io.SeekCurrent) - return err - } - return nil + // we skip checking the prefix for performance reasons because we assume + // that it was checked by the caller + _, err := r.Seek(int64(n), io.SeekCurrent) + return err } // AppendVarUInt32 creates a new key prefix, by encoding and appending a