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

Handle empty TPI and IPI streams #60

Merged
merged 2 commits into from
Mar 17, 2020
Merged

Handle empty TPI and IPI streams #60

merged 2 commits into from
Mar 17, 2020

Conversation

jan-auer
Copy link
Member

The ID stream may be completely empty if there are no ids in a PDB. Parsing the header fails in this case with an UnexpectedEof error, which is not clean. Instead, we can return an Option that explicitly indicates that there is no ID information available.

@jan-auer jan-auer self-assigned this Sep 18, 2019
@jan-auer
Copy link
Member Author

Alternatively, we could also create an empty object.

@jan-auer
Copy link
Member Author

@willglynn I've pushed up an alternate implementation where IdInformation is not optional. Instead, it internally handles an empty stream. While implementing, I noticed that the shifted count was not rounded up properly. However, returning 0 as max_index for such streams seems like a bit of a hack.

@jan-auer jan-auer force-pushed the fix/optional-id-stream branch 2 times, most recently from 14c3885 to 5599620 Compare September 26, 2019 16:30
@jan-auer
Copy link
Member Author

Going with the second option now, as it seems a bit more ergonomic.

@jan-auer jan-auer changed the title Make the id stream optional Handle empty TPI and IPI streams Mar 17, 2020
@jan-auer jan-auer merged commit 1048d19 into master Mar 17, 2020
@jan-auer jan-auer deleted the fix/optional-id-stream branch March 17, 2020 11:03
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.

1 participant