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

Store length instead of endOffset in Java and Ruby objects #939

Merged
merged 3 commits into from
Jun 2, 2023

Conversation

eregon
Copy link
Member

@eregon eregon commented Jun 1, 2023

For #872

@eregon eregon requested review from jemmaissroff and kddnewton June 1, 2023 17:53
@eregon
Copy link
Member Author

eregon commented Jun 1, 2023

This is ready for review/merge.
I'll look at changing to length in C structs separately, that's much more involved.

Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

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

Just one question, but otherwise looks good

lib/yarp.rb Outdated
end

def deconstruct_keys(keys)
{ start_offset: start_offset, end_offset: end_offset }
{ start_offset: start_offset, end_offset: end_offset } # TODO
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the TODO here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering if we should change the deconstruct_keys to include length instead of end_offset.
But it doesn't seem so useful and things like pretty_print should still show the end_offset as that seems more readable, and would be noisy to change.
I'll just remove it, I can try it later and see whether that makes sense.

@eregon eregon force-pushed the length-instead-of-endOffset branch from daf5a17 to f7b7bc5 Compare June 1, 2023 20:40
Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

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

Looks great

@kddnewton kddnewton merged commit 38055fa into ruby:main Jun 2, 2023
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.

2 participants