QasimKhan5d commented on code in PR #29: URL: https://github.com/apache/datasketches-go/pull/29#discussion_r2002981253
########## cpc/pair_table.go: ########## @@ -237,3 +237,63 @@ func mergePairs(arrA []int, startA, lengthA int, arrB []int, startB, lengthB int c++ } } + +// Copy creates and returns a deep copy of the pairTable. +func (p *pairTable) Copy() *pairTable { + // Create a new pairTable using the same lgSizeInts and validBits. + newPT, err := NewPairTable(p.lgSizeInts, p.validBits) + if err != nil { + // This should not happen if p is valid. + panic(err) Review Comment: returning nil, error instead -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@datasketches.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@datasketches.apache.org For additional commands, e-mail: dev-h...@datasketches.apache.org