util: remove bogus check from BinWriter.WriteVarUint()

val is uint64, it can't be less than zero by definition.
This commit is contained in:
Roman Khimov 2019-09-15 15:48:20 +03:00
parent aacf58c9ab
commit 72fc880182

View file

@ -2,7 +2,6 @@ package util
import (
"encoding/binary"
"errors"
"io"
)
@ -41,15 +40,6 @@ func (w *BinWriter) WriteVarUint(val uint64) {
return
}
if val < 0 {
w.Err = errors.New("value out of range")
return
}
if w.Err != nil {
return
}
if val < 0xfd {
w.Err = binary.Write(w.w, binary.LittleEndian, uint8(val))
return