Fastream Technologies wrote: > Hello, > > I have fixed the function as below (providing for the sake of > completeness):
You are re-inventing the wheel. Simply set property TStringList.Sorted to True and a Add() or AddObject() uses binary search to Insert data at the right index. As I mentioned recently, for a cache that frequently gets new entries this is not the right data structure since Inserts are too slow. A binary search tree performs better, have a look at the my demo and note the faster Insert speed of TAvlObjectTree: http://www.duodata.de/misc/delphi/ics/Project1.zip -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be