Skip to content

Commit 33d8091

Browse files
committed
use inlined procedure directly
1 parent 5a279da commit 33d8091

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

entries/ghatem-fpc/src/OneBRC.lpr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ procedure TOneBRC.GenerateOutput;
564564
vHash: Cardinal;
565565
vStations: TStringList;
566566
iStationName: AnsiString;
567+
vIdx: THashSize;
568+
vRes: Boolean;
567569
begin
568570
vStream := TStringStream.Create;
569571
vStations := TStringList.Create;
@@ -587,7 +589,10 @@ procedure TOneBRC.GenerateOutput;
587589
// would it be more efficient to store the hash as well?
588590
// debatable, and the whole output generation is < 0.3 seconds, so not exactly worth it
589591
vHash := crc32c(0, @vStations[i][1], Length (vStations[i]));
590-
FDictionary.TryGetValue(vHash, 0, vData);
592+
593+
FDictionary.InternalFind (vHash, vRes, vIdx);
594+
vData := @FDictionary.FThreadData[0][FDictionary.FIndexes[vIdx]];
595+
591596
vMean := RoundExInteger(vData^.Sum/vData^.Count/10);
592597

593598
vStream.WriteString(

0 commit comments

Comments
 (0)