Add BitSeq.isZeros
This commit is contained in:
parent
19fd0cc489
commit
5e11e1f1db
|
@ -245,3 +245,8 @@ func isSubsetOf*(a, b: BitSeq): bool =
|
||||||
return false
|
return false
|
||||||
true
|
true
|
||||||
|
|
||||||
|
proc isZeros*(x: BitSeq): bool =
|
||||||
|
for w in words(x):
|
||||||
|
if w != 0: return false
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
|
@ -147,9 +147,7 @@ func readVarint*[Stream](input: var Stream,
|
||||||
##
|
##
|
||||||
## * `ValueError`
|
## * `ValueError`
|
||||||
## The stream contained an invalid varint value.
|
## The stream contained an invalid varint value.
|
||||||
var
|
var parser: VarintParser[type(outVal), flavour]
|
||||||
parser: VarintParser[type(outVal), flavour]
|
|
||||||
pos = input.pos
|
|
||||||
|
|
||||||
while not input.eof:
|
while not input.eof:
|
||||||
case parser.feedByte(input.read)
|
case parser.feedByte(input.read)
|
||||||
|
|
Loading…
Reference in New Issue