Closed eric closed 12 years ago
I actually got further on it. The problem is when the key is of a different type:
https://github.com/eric/avl_tree/compare/delete-with-different-types
It looks like the problem is <=>
returns nil
if the types don't match, and there is no case for that.
Ah, thanks for the investigation. We removed 'key.to_s' so <=> could return nil now. I'm going to change trees to raise TypeError when <=> returns nil for both #insert and #delete. Do you think it's OK for you?
Yeah, I think that makes sense. At least I'll be able to figure out where my bug is.
I just got a report of this: https://github.com/eric/metriks/issues/13
It looks like the problem is that if you try to delete a key that wasn't found, it still tries to call
#value
on the result.