File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -563,13 +563,11 @@ function MyFormatInt (const aIn: SmallInt): AnsiString; inline;
563563// ---------------------------------------------------
564564
565565procedure TOneBRC.GenerateOutput ;
566- var vMean: Integer;
567- vStream: TStringStream;
566+ var vStream: TStringStream;
568567 I, N: Int64;
569568 vData: PStationData;
570569 vHash: Cardinal;
571570 vStations: TStringList;
572- iStationName: AnsiString;
573571 vIdx: THashSize;
574572 vRes: Boolean;
575573begin
@@ -579,8 +577,8 @@ procedure TOneBRC.GenerateOutput;
579577 vStations.UseLocale := False;
580578 try
581579 vStations.BeginUpdate;
582- for iStationName in FDictionary.FStationNames do begin
583- vStations.Add(iStationName );
580+ for I := 0 to N - 1 do begin
581+ vStations.Add(FDictionary.FStationNames[I] );
584582 end ;
585583 vStations.EndUpdate;
586584 vStations.CustomSort (@Compare);
@@ -598,11 +596,9 @@ procedure TOneBRC.GenerateOutput;
598596 FDictionary.InternalFind (vHash, vRes, vIdx);
599597 vData := @FDictionary.FThreadData[0 ][FDictionary.FIndexes[vIdx]];
600598
601- vMean := RoundExInteger(vData^.Sum/vData^.Count/10 );
602-
603599 vStream.WriteString(
604600 vStations[i] + ' =' + MyFormatInt(vData^.Min)
605- + ' /' + MyFormatInt(vMean )
601+ + ' /' + MyFormatInt(RoundExInteger(vData^.Sum/vData^.Count/ 10 ) )
606602 + ' /' + MyFormatInt(vData^.Max) + ' , '
607603 );
608604 Inc(I);
You can’t perform that action at this time.
0 commit comments