refactor: orm/encoding/encodeutil: remove impossible len overflow check (#17643)

This commit is contained in:
Emmanuel T Odeke 2023-09-11 14:07:58 +03:00 committed by GitHub
parent 1938950564
commit d053fc0956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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