During code analysis there are many places which could be very easily optimized and/or consolidated
example for optimization:
Procedure DoDirSeparators (Var FileName : PathStr); {$ifdef FPC_HAS_CPSTRING}rtlproc;{$endif}
VAr I : longint;
begin
For I:=1 to Length(FileName) do
If CharInSet(FileName[I],AllowDirectorySeparators) then
FileName[i]:=DirectorySeparator;
end;
in my case FileName has '/', which is replaced in cycle with the same value, but for each assignment <fpc_ansistr_unique> is called
for consolidation - I prefer Delphi sources style, so:
- Procedure - should be procedure, and no space between DoDirSeparators and (
- VAr I : longint;
should be:
var
i: Longint;
without enter before & after
also var name is declared as I, but used as I and i
- code: For I:=1 to Length(FileName) do
should be:
for i := 1 to Length(FileName) do
- code: FileName
:=DirectorySeparator;
should be:
FileName := DirectorySeparator;
How I can take part in code updates and devote my time to make FPC better?