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