Ok, so I'm overriding the Compare method in one of my types so I can sort a list of them easily using Tlist.Sort(). So far so good, easy stuff, works. Now when it comes to using Tlist.Contains() on the same set of objects, everything breaks. Looking at linkedlist.bmx, Contains() checks if Compare() returns 0 for each item in the list, assuming that means they're the same. Obviously, as I've overridden Compare(), it will return 0 for things that aren't exactly the same object. Everything breaks; I'm not happy.
I can't think of a way round this, other than writing my own version of either Sort or Contains. Is there a sensible reason why Contains uses _value.Compare(value) and not just _value=value?
Edit: I'm an eejit, it was returning null because the thing was actually null :P
And I now see Compare() in Contains would always work because it's using Object.Compare(), not whatever I've got.
I can't think of a way round this, other than writing my own version of either Sort or Contains. Is there a sensible reason why Contains uses _value.Compare(value) and not just _value=value?
Edit: I'm an eejit, it was returning null because the thing was actually null :P
And I now see Compare() in Contains would always work because it's using Object.Compare(), not whatever I've got.