Fix a bug in bit_array's sub function (#2506)

This commit is contained in:
JamesRay
2018-10-03 10:28:46 +04:00
committed by Anton Kaliaev
parent f3d08f969d
commit c94133ed1b
2 changed files with 29 additions and 1 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ func (bA *BitArray) Sub(o *BitArray) *BitArray {
if bA.Bits > o.Bits {
c := bA.copy()
for i := 0; i < len(o.Elems)-1; i++ {
c.Elems[i] &= ^c.Elems[i]
c.Elems[i] &= ^o.Elems[i]
}
i := len(o.Elems) - 1
if i >= 0 {