Finding Specific item in a list..

BlitzMax Forums/BlitzMax Beginners Area/Finding Specific item in a list..

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.

Yes, use TMap instead of TList
TMap is an assoziative structure, which lets you retrieve the value to a given key (in this case the name) in O(log(N)) time (N is the number of elements stored in the TMap), which is significantly faster than the O(n) of the list and besides that allows you to bind it uniquely to a name.

The alternative to this is an own class CAR which has a field of type TLink, used for sorting if this is the reason you put it into the list.
the value would then be a field as well.