The Duplicates property on TStringList has no effect unless the list
is sorted, so setting Duplicates on an unsorted list is either an unnecessary line
of code or a bug.
Note that for the purposes of this rule, the list must be sorted in the same block where
Duplicates is set.
If the list should be forbidding duplicates, sort the list:
procedure DoSomething(MyList: TStringList); begin MyList.Duplicates := dupError; // ... end;
procedure DoSomething(MyList: TStringList); begin MyList.Sorted := True; MyList.Duplicates := dupError; // ... end;
If the list should not be forbidding duplicates, remove the assignment:
procedure DoSomething(MyList: TStringList); begin MyList.Duplicates := dupError; // ... end;
procedure DoSomething(MyList: TStringList); begin // ... end;