You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code triggers an unnecessary strong type-check in RBTree#merge!
.../gems/2.2.0/gems/rbtree-pure-0.1.1/lib/rbtree/rb_tree.rb:409:in `merge!': wrong argument type Index (expected RBTree) (TypeError)
The type-check is only needed if the block is given (the other path works with a Hash),
and even that path should use kind_of?, not instance_of?
Even better would be to detect that kind_of?(RBTree) is false and use a generic code path.
require "rbtree"
class Index < RBTree
end
i = Index.new
i[:a] = 1
j = Index.new
j[:b] = 2
j.merge!(i)
The text was updated successfully, but these errors were encountered:
The following code triggers an unnecessary strong type-check in RBTree#merge!
.../gems/2.2.0/gems/rbtree-pure-0.1.1/lib/rbtree/rb_tree.rb:409:in `merge!': wrong argument type Index (expected RBTree) (TypeError)
The type-check is only needed if the block is given (the other path works with a Hash),
and even that path should use kind_of?, not instance_of?
Even better would be to detect that kind_of?(RBTree) is false and use a generic code path.
The text was updated successfully, but these errors were encountered: