History: Read change positions at once #2542
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Description
As a cleanup for v3, I'd like to go from the 3 methods to read a location to one. The current design is flawed; all implementations actually read the whole position in the
readX
method, requiring the methods to be called in the correct order.By instead only using one method, we can simplify the code and make it less error-prone. It would also be possible to avoid the
byte[]
buffers in future this way.I also marked some classes I touched as internal. They aren't currently, but I don't think they are useful to other developers at all.
Due to the (theoretically) breaking changes and the low priority, this targets v3.
Submitter Checklist