Tlist Compare, Sort, and Contains, or Why God Why

BlitzMax Forums/BlitzMax Programming/Tlist Compare, Sort, and Contains, or Why God Why

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

TList.Remove() is fundamentally flawed anyway. The documentation is wrong (or rather inconsistent with the comments in TLink.Remove() which suggests it is the more effiecient version of TList.Remove() )

You can't even use TList.FindLink( object ) in order to find the link and remove it using link.Remove() - since TList.FindLink() uses Compare().

Note, this is only a problem if you override the Compare() function - which you need to do to perform a sort.

Dreamora: your Compare function is incorrect - Swift has implemented a correct Compare function as per the definition. However - due to the flaws listed above there is a conflict between sorting and finding an object in a list - Mark's fault.