shed bitfield: use Count to check for overflows

This commit is contained in:
Łukasz Magiera 2020-04-28 21:36:58 +02:00
parent 4579e9bb84
commit 6014530145

View File

@ -172,6 +172,10 @@ var bitFieldStatCmd = &cli.Command{
}
}
if _, err := rle.Count(); err != nil { // check overflows
fmt.Println("Error: ", err)
}
fmt.Printf("Decoded length: %d bits\n", ones+zeros)
fmt.Printf("\tOnes: %d\n", ones)
fmt.Printf("\tZeros: %d\n", zeros)