java/src/rbtree/ext/MultiRBTree.java in rbtree-jruby-0.2.0 vs java/src/rbtree/ext/MultiRBTree.java in rbtree-jruby-0.2.1
- old
+ new
@@ -561,11 +561,11 @@
return nodeOrDefault(context, maximum(), true);
}
@JRubyMethod
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block) {
- Node node = lower_boundInternal(context, key);
- if (node.isNull()) {
+ Node node = internalGet(context, (RubyObject) key);
+ if (node == null) {
if (block.isGiven()) {
return block.yield(context, key);
}
return getRuntime().getNil();
}