-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Add Set#reset #4957
Conversation
Please note that the test will fail because of this issue |
if (tmp.isNil()) { | ||
modifyCheck(context.runtime); | ||
} else { | ||
System.out.println("rehash"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.hash
is 'internal' -> can not be changed (wout hacks) on .rb end ... + its already of type RubyHash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understand correct :/ What should I use instead this.hash
.
The type check is adapted from the MRI implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
...
0c36854
to
5f7e117
Compare
https://bugs.ruby-lang.org/issues/6589 Tests c&p from ruby/ruby@8c90432. Supports jruby#4876
5f7e117
to
54b0eeb
Compare
Thanks Chris, well done! |
https://bugs.ruby-lang.org/issues/6589
Tests c&p from ruby/ruby@8c90432.
Supports #4876