Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generic list and duplicate records

Using the generic TList collection: Is there some function that detects duplicate records or do I need to do a search on all records and check single field if duplicated or not?

like image 673
Marcello Impastato Avatar asked Nov 06 '11 15:11

Marcello Impastato


1 Answers

The generic TList has a Contains method that can be used to detect duplicates. But you have to call this yourself as there is no Duplicates property as there is for TStringList.

If your data can be compared with a binary compare then there is nothing more to do. Otherwise you need to supply a custom comparer.

like image 153
David Heffernan Avatar answered Sep 18 '22 04:09

David Heffernan