View Issue Details

IDProjectCategoryView StatusLast Update
0034303FPCRTLpublic2019-12-23 14:17
ReporterCudaText man Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.0.4 
Fixed in Version3.3.1 
Summary0034303: StringList micro optimize
DescriptionTStringList
a)
Procedure TStrings.Append(const S: string);
begin
  Add (S);
end;

maybe add "inline" here?

b)
  If Not (SortStyle=sslAuto) then
  -->
  if SortStyle<>sslAuto then
TagsNo tags attached.
Fixed in Revision43714
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

CudaText man

2018-09-19 20:07

reporter   ~0110890

c)
procedure TStringList.CustomSort(CompareFn: TStringListSortCompare);
begin
  If (FForceSort or (Not (FSortStyle=sslAuto))) and (FCount>1) then
  -->
  if (FCount>1) and (FForceSort or (FSortStyle<>sslAuto)) then

Serge Anvarov

2018-09-19 21:52

reporter   ~0110892

Add(S) is a virtual method call. It's longer than Append. I think inline is not useful.

CudaText man

2019-12-16 12:48

reporter   ~0119883

What about
b)
  If Not (SortStyle=sslAuto) then
  -->
  if SortStyle<>sslAuto then

c)
procedure TStringList.CustomSort(CompareFn: TStringListSortCompare);
begin
  If (FForceSort or (Not (FSortStyle=sslAuto))) and (FCount>1) then
  -->
  if (FCount>1) and (FForceSort or (FSortStyle<>sslAuto)) then

Michael Van Canneyt

2019-12-23 14:17

administrator   ~0120038

I changed the sslAuto comparisons. I consider this readability improvements.

As for inline, please don't report missing 'inline' in the future.

The compiler devels asked no longer to do this, as compiler auto-inline should be used as much as possible.

Issue History

Date Modified Username Field Change
2018-09-19 20:02 CudaText man New Issue
2018-09-19 20:07 CudaText man Note Added: 0110890
2018-09-19 21:52 Serge Anvarov Note Added: 0110892
2019-12-16 12:48 CudaText man Note Added: 0119883
2019-12-23 14:17 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-12-23 14:17 Michael Van Canneyt Status new => resolved
2019-12-23 14:17 Michael Van Canneyt Resolution open => fixed
2019-12-23 14:17 Michael Van Canneyt Fixed in Version => 3.3.1
2019-12-23 14:17 Michael Van Canneyt Fixed in Revision => 43714
2019-12-23 14:17 Michael Van Canneyt FPCTarget => 3.2.0
2019-12-23 14:17 Michael Van Canneyt Note Added: 0120038