A long while ago, I posted a detailed answer on what functions the default comparers actually were calling to get a feel for if they would apply or not answering delphi – What does the default TArray.Sort comparator actually do and when would you use it? – Stack Overflow.
I needed that information recently because of some sorting issues I bumped into (sorting generic records), so finally a blog post.
First some links to documentation for even more background information:
- System.Generics.Collections:
– TArray.Sort method. - System.Generics.Defaults:
– IComparer interface with the Compare method.
– IEqualityComparer with the Equals and GetHashCode methods.
– _LookupVtableInfo.
– BinaryCompare.
– BobJenkinsHash.
– TOrdinalIStringComparer. - Generics Defaults TComparer (Delphi) – RAD Studio Code Examples.
There is the answer I gave: Read the rest of this entry »