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

ORC-187: Simplify BitFieldReader to only support single bits #186

Closed
wants to merge 3 commits into from

Conversation

rajeshbalamohan
Copy link

No description provided.

current = input.next();
bitsLeft = (int) (8 - (totalBits % 8));
final long bitsToSkip = (totalBits - availableBits);
input.skip(Math.min(1, bitsToSkip / 8));
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks a bit odd - the min(1) might be a problem if

availableBits = 0 and items=3, it will end up skip(1) where it should really be doing skip(0).

@t3rmin4t0r
Copy link
Contributor

LGTM - +1

@omalley
Copy link
Contributor

omalley commented Nov 7, 2017

Since this is removing the old functionality, you should remove the old constructor that takes the bitWidth. With this change, someone who passed in a non-one width would be surprised with the result.

@rajeshbalamohan rajeshbalamohan changed the title ORC-187: BitFieldReader has an unnecessary loop ORC-187: Simplify BitFieldReader to only support single bits Nov 7, 2017
@t3rmin4t0r
Copy link
Contributor

@asfgit merge

@asfgit asfgit closed this in 0ee4b10 Nov 8, 2017
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.

4 participants