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

Add Set#reset #4957

Merged
merged 1 commit into from Jan 10, 2018
Merged

Add Set#reset #4957

merged 1 commit into from Jan 10, 2018

Conversation

@ChrisBr
Copy link
Contributor

@ChrisBr ChrisBr commented Jan 8, 2018

https://bugs.ruby-lang.org/issues/6589
Tests c&p from ruby/ruby@8c90432.
Supports #4876

@ChrisBr
Copy link
Contributor Author

@ChrisBr ChrisBr commented Jan 8, 2018

Please note that the test will fail because of this issue
#4958

if (tmp.isNil()) {
modifyCheck(context.runtime);
} else {
System.out.println("rehash");

This comment has been minimized.

@kares

kares Jan 9, 2018
Member

✂️

This comment has been minimized.

@ChrisBr

ChrisBr Jan 9, 2018
Author Contributor

😢

@@ -875,6 +876,18 @@ public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
return context.runtime.getFalse();
}

@JRubyMethod(name = "reset")
public IRubyObject reset(ThreadContext context) {
IRubyObject tmp = TypeConverter.checkHashType(context.runtime, this.hash);

This comment has been minimized.

@kares

kares Jan 9, 2018
Member

this.hash is 'internal' -> can not be changed (wout hacks) on .rb end ... + its already of type RubyHash

This comment has been minimized.

@ChrisBr

ChrisBr Jan 9, 2018
Author Contributor

Not sure if I understand correct :/ What should I use instead this.hash.
The type check is adapted from the MRI implementation.

This comment has been minimized.

@kares

kares Jan 9, 2018
Member

The type check is adapted from the MRI implementation.

figured, since this as a native part, specific to JRuby, just logically simplify what makes sense.
since you have a RubyHash hash you do not need any type-checking whether its a Hash ...

@kares kares added this to the JRuby 9.3.0.0 milestone Jan 9, 2018
@ChrisBr ChrisBr force-pushed the ChrisBr:feature/set-rehash branch 2 times, most recently from 0c36854 to 5f7e117 Jan 9, 2018
@ChrisBr ChrisBr force-pushed the ChrisBr:feature/set-rehash branch from 5f7e117 to 54b0eeb Jan 9, 2018
@kares
kares approved these changes Jan 10, 2018
@kares
Copy link
Member

@kares kares commented Jan 10, 2018

Thanks Chris, well done!

@kares kares merged commit 1b99cd3 into jruby:ruby-2.5 Jan 10, 2018
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.0.0 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants