roaring icon indicating copy to clipboard operation
roaring copied to clipboard

The p return value from Bitmap.FromUnsafeBytes is incorrect

Open anacrolix opened this issue 1 year ago • 1 comments

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

anacrolix avatar Sep 16 '24 11:09 anacrolix

@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)

lemire avatar Sep 16 '24 18:09 lemire