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

The p return value from Bitmap.FromUnsafeBytes is incorrect #444

Open
anacrolix opened this issue Sep 16, 2024 · 1 comment
Open

The p return value from Bitmap.FromUnsafeBytes is incorrect #444

anacrolix opened this issue Sep 16, 2024 · 1 comment

Comments

@anacrolix
Copy link
Contributor

The p return value from Bitmap.FromUnsafeBytes is incorrect and untested.

I experimented with using it to read consecutive packed bitmaps for the BSI implementation but it resulted in different p values than ReadFrom. I took a quick look at the tests and it wasn't checked in the unit tests when the feature was added.

@damnever

@lemire
Copy link
Member

lemire commented Sep 16, 2024

@anacrolix

The p return value from Bitmap.FromUnsafeBytes is incorrect

Please provide evidence. A simple example would suffice.

I strongly discourage such vague statements.

untested

I have added a test. Note that the function is made of two lines of code.

	stream := internal.NewByteBuffer(data)
	return rb.ReadFrom(stream)

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

No branches or pull requests

2 participants