Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

bitmuncher: add missing methods from stream reader #1123

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

gucio321
Copy link
Contributor

No description provided.

gravestench
gravestench previously approved these changes May 11, 2021
@gucio321 gucio321 marked this pull request as draft May 15, 2021 07:28
@gucio321
Copy link
Contributor Author

I think, that I'll add something more here

Comment on lines 63 to 71
func (v *BitMuncher) GetBit() uint32 {
result := uint32(v.data[v.offset/byteLen]>>uint(v.offset%byteLen)) & oneBit
func (v *BitMuncher) GetBit() bool {
result := v.data[v.offset/byteLen] >> uint(v.offset%byteLen) & oneBit
v.offset++
v.bitsRead++

return result
return result == 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about it? result will be stored in a single-byte variable (instead of 4-byte uint32)

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

Successfully merging this pull request may close these issues.

None yet

2 participants