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

Support index/length args for string passed to String#bytesplice #3674

Merged

Conversation

rwstauner
Copy link
Collaborator

Additional args were added in 3.3 to support taking a substring of the provided string argument.

I applied similar logic to the new args as was already present for the receiver and just used them with str.byteslice. I'm not sure if there's a more efficient way to do it in the java, but this seems to at least produce the correct result.

I took the existing specs, duplicated them, and then rearranged the args so that the test applied to the args for the str arg instead of the receiver string.

Closes #3656

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 19, 2024
Copy link
Member

@andrykonchin andrykonchin left a comment

Choose a reason for hiding this comment

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

Looks good. There are very few subjective comments that you can ignore.

spec/ruby/core/string/bytesplice_spec.rb Show resolved Hide resolved
spec/ruby/core/string/bytesplice_spec.rb Show resolved Hide resolved
src/main/ruby/truffleruby/core/string.rb Show resolved Hide resolved
@rwstauner rwstauner force-pushed the rwstauner/bytesplice-str-idx-len branch from b6e1c88 to 74b3a42 Compare September 24, 2024 16:30
@andrykonchin andrykonchin added the in-ci The PR is being tested in CI. Do not push new commits. label Sep 25, 2024
@graalvmbot graalvmbot merged commit 36351cd into oracle:master Sep 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
3 participants