Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SetBitsetFrom() to resolve #85 #104

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

SignorMercurio
Copy link
Contributor

This should close #85 .

Test results:

$ go test -cover
PASS
coverage: 89.7% of statements
ok      github.com/bits-and-blooms/bitset       0.121s

@lemire
Copy link
Member

lemire commented Apr 21, 2022

How does that compare with the existing function...

// FromWithLength constructs from an array of integers and length.
func FromWithLength(len uint, set []uint64) *BitSet {
	return &BitSet{len, set}
}

@SignorMercurio
Copy link
Contributor Author

How does that compare with the existing function...

// FromWithLength constructs from an array of integers and length.
func FromWithLength(len uint, set []uint64) *BitSet {
	return &BitSet{len, set}
}

According to #85, the newly added SetBitsetFrom() does not create a new BitSet instance, thus does not allocate new space. It only modifies the existing BitSet instance.

@lemire lemire merged commit 5de9461 into bits-and-blooms:master Apr 21, 2022
@lemire
Copy link
Member

lemire commented Apr 21, 2022

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

From() without a new allocation
2 participants