Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions entries/ghatem-fpc/src/OneBRC.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,12 @@ procedure TOneBRC.ProcessData (aThreadNb: TThreadCount; aStartIdx: Int64; aEndId
vLineStart := i;

while i < aEndIdx do begin

// can still skip some chars
if FData[i] > ';' then begin
Inc (I, 5);
end;

while FData[i] <> #10 do begin
Inc (I);
end;
Expand Down Expand Up @@ -574,8 +580,7 @@ procedure TOneBRC.GenerateOutput;
try
vStations.BeginUpdate;
for iStationName in FDictionary.FStationNames do begin
if iStationName <> '' then
vStations.Add(iStationName);
vStations.Add(iStationName);
end;
vStations.EndUpdate;
vStations.CustomSort (@Compare);
Expand Down Expand Up @@ -622,7 +627,6 @@ procedure TOneBRC.GenerateOutput;
procedure TBRCThread.Execute;
begin
FProc (FThreadNb, FStart, FEnd);
Terminate;
end;

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