Copy returns a copy of the provided bit array.
()
| 82 | |
| 83 | // Copy returns a copy of the provided bit array. |
| 84 | func (bA *BitArray) Copy() *BitArray { |
| 85 | if bA == nil { |
| 86 | return nil |
| 87 | } |
| 88 | bA.mtx.Lock() |
| 89 | defer bA.mtx.Unlock() |
| 90 | return bA.copy() |
| 91 | } |
| 92 | |
| 93 | func (bA *BitArray) copy() *BitArray { |
| 94 | c := make([]uint64, len(bA.Elems)) |