TIniFile: tiny optimizations
Original Reporter info from Mantis: Alextp
-
Reporter name: CudaText man
Description:
1) simplify
was:
function IsComment(const AString: string): boolean;
begin
Result := False;
if AString > '' then
Result := (Copy(AString, 1, 1) = Comment);
end;
new:
function IsComment(const AString: string): boolean;
begin
Result := (AString <> '') and (AString[1] = Comment);
end;
2) FillSectionList()
make var to store AStrings.Strings[0] here:
if (AStrings.Count > 0) and (copy(AStrings.Strings[0],1,Length(Utf8Bom)) = Utf8Bom) then
begin
FBOM := Utf8Bom;
AStrings.Strings[0] := copy(AStrings.Strings[0],Length(Utf8Bom)+1,Length(AStrings.Strings[0]));
end;
3) use string indexing instead of Copy
if (Copy(sLine, 1, 1) = Brackets[0]) and (Copy(sLine, length(sLine), 1) = Brackets[1]) then
new:
if (SLine[1] = Brackets[0]) and (SLine[length(SLine)] = Brackets[1]) then
Mantis conversion info:
-
Mantis ID: 33981
-
Platform: Linux
-
Version: 3.0.4
-
Fixed in version: 3.1.1
-
Fixed in revision: 39450 (#b417ab79)
-
Target version: 3.2.0