lists, use builtin dup deletion method

This commit is contained in:
Basile Burg 2016-09-16 21:30:45 +02:00
parent 57ef887aad
commit acebde858c
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
4 changed files with 8 additions and 24 deletions

View File

@ -265,11 +265,6 @@ type
*)
function isStringDisabled(const str: string): boolean;
(**
* Deletes the duplicates in a TStrings instance.
*)
procedure deleteDups(str: TStrings);
(**
* Indicates wether str is only made of blank characters
*)
@ -1176,19 +1171,6 @@ begin
result := true;
end;
procedure deleteDups(str: TStrings);
var
i: integer;
begin
{$PUSH}{$HINTS OFF}
if str = nil then exit;
for i:= str.Count-1 downto 0 do
// if less than 0 -> not found -> unsigned -> greater than current index.
if cardinal(str.IndexOf(str[i])) < i then
str.Delete(i);
{$POP}
end;
function isBlank(const str: string): boolean;
var
c: char;

View File

@ -274,6 +274,10 @@ begin
fConfigs := TStringList.Create;
fSrcs := TStringList.Create;
fImportPaths := TStringList.Create;
fSrcs.Duplicates:=TDuplicates.dupIgnore;
fImportPaths.Duplicates:=TDuplicates.dupIgnore;
fConfigs.Duplicates:=TDuplicates.dupIgnore;
fBuildTypes.Duplicates:=TDuplicates.dupIgnore;
//
subjProjNew(fProjectSubject, self);
subjProjChanged(fProjectSubject, self);
@ -844,7 +848,6 @@ begin
tryAddRelOrAbsFile(arr.Strings[i]);
end;
end;
deleteDups(fSrcs);
// exclusions
lst.Clear;
getExclusion(fJSON);

View File

@ -2608,6 +2608,7 @@ begin
ldc: dmdProc.Executable :='ldmd2' + exeExt;
gdc: dmdProc.Executable :='gdmd' + exeExt;
end;
TStringList(dmdproc.Parameters).Duplicates:=TDuplicates.dupIgnore;
dmdproc.Parameters.Add(fDoc.fileName);
if not asObj then
dmdproc.Parameters.Add('-of' + fname + exeExt)
@ -2645,8 +2646,6 @@ begin
LibMan.getLibFiles(nil, dmdproc.Parameters);
LibMan.getLibSourcePath(nil, dmdproc.Parameters);
end;
deleteDups(dmdproc.Parameters);
dmdproc.Execute;
while dmdproc.Running do
application.ProcessMessages;

View File

@ -37,7 +37,7 @@ type
fRunnerOldCwd: string;
fLibAliases: TStringList;
fConfigs: TCollection;
fSrcs, fSrcsCop: TStringList;
fSrcs: TStringList;
fConfIx: Integer;
fUpdateCount: NativeInt;
fProjectSubject: TCEProjectSubject;
@ -151,9 +151,10 @@ begin
fProjectSubject := TCEProjectSubject.create;
//
fLibAliases := TStringList.Create;
fLibAliases.Duplicates:=TDuplicates.dupIgnore;
fSrcs := TStringList.Create;
fSrcs.Duplicates:=TDuplicates.dupIgnore;
fSrcs.OnChange := @subMemberChanged;
fSrcsCop := TStringList.Create;
fConfigs := TCollection.create(TCompilerConfiguration);
//
reset;
@ -177,7 +178,6 @@ begin
fOnChange := nil;
fLibAliases.Free;
fSrcs.free;
fSrcsCop.Free;
fConfigs.free;
killProcess(fRunner);
inherited;