View Issue Details

IDProjectCategoryView StatusLast Update
0033981FPCFCLpublic2018-08-11 21:32
ReporterAlexey Tor.Assigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSOS Version
Product Version3.0.4Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033981: TIniFile: tiny optimizations
Description1) 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
TagsNo tags attached.
Fixed in Revision39450
FPCOldBugId
FPCTarget
Attached Files

Activities

Michael Van Canneyt

2018-07-14 10:27

administrator   ~0109445

Applied as suggested, thank you very much.

Issue History

Date Modified Username Field Change
2018-07-13 18:44 Alexey Tor. New Issue
2018-07-14 00:56 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-07-14 00:56 Michael Van Canneyt Status new => assigned
2018-07-14 10:27 Michael Van Canneyt Fixed in Revision => 39450
2018-07-14 10:27 Michael Van Canneyt Note Added: 0109445
2018-07-14 10:27 Michael Van Canneyt Status assigned => resolved
2018-07-14 10:27 Michael Van Canneyt Fixed in Version => 3.1.1
2018-07-14 10:27 Michael Van Canneyt Resolution open => fixed
2018-07-14 10:27 Michael Van Canneyt Target Version => 3.2.0
2018-08-11 21:32 Alexey Tor. Status resolved => closed