Skip to content

Commit 75b13b2

Browse files
authored
Merge pull request #162 from georges-hatem/main
more skip chars
2 parents e02bf1f + b7f6422 commit 75b13b2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

entries/ghatem-fpc/src/OneBRC.lpr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,12 @@ procedure TOneBRC.ProcessData (aThreadNb: TThreadCount; aStartIdx: Int64; aEndId
459459
vLineStart := i;
460460

461461
while i < aEndIdx do begin
462+
463+
// can still skip some chars
464+
if FData[i] > ';' then begin
465+
Inc (I, 5);
466+
end;
467+
462468
while FData[i] <> #10 do begin
463469
Inc (I);
464470
end;
@@ -574,8 +580,7 @@ procedure TOneBRC.GenerateOutput;
574580
try
575581
vStations.BeginUpdate;
576582
for iStationName in FDictionary.FStationNames do begin
577-
if iStationName <> '' then
578-
vStations.Add(iStationName);
583+
vStations.Add(iStationName);
579584
end;
580585
vStations.EndUpdate;
581586
vStations.CustomSort (@Compare);
@@ -622,7 +627,6 @@ procedure TOneBRC.GenerateOutput;
622627
procedure TBRCThread.Execute;
623628
begin
624629
FProc (FThreadNb, FStart, FEnd);
625-
Terminate;
626630
end;
627631

628632
constructor TBRCThread.Create(aProc: TThreadProc; aThreadNb: TThreadCount; aStart: Int64; aEnd: Int64);

0 commit comments

Comments
 (0)