File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 1212
1313const
1414 cNumStations = 42000 ;
15- cDictSize = 42000 * 4 ;
15+ cDictSize = 42000 * 4 + 1 ;
1616 cThreadCount = 32 ;
1717
1818 c0ascii: ShortInt = 48 ;
@@ -285,10 +285,10 @@ procedure TOneBRC.ExtractLineData(const aStart: Int64; const aEnd: Int64; out aL
285285 // can safely skip 3: ^^^
286286 J := aEnd - 3 ;
287287
288- while True do begin
289- if FData[J] = ' ; ' then
290- break;
291- Dec(J);
288+ if FData[J] <> ' ; ' then begin
289+ Dec (J);
290+ if FData[J] <> ' ; ' then
291+ Dec(J);
292292 end ;
293293 // I is the position of the semi-colon, extract what's before and after it
294294
@@ -313,13 +313,16 @@ procedure TOneBRC.ExtractLineData(const aStart: Int64; const aEnd: Int64; out aL
313313 // aTemp := -aTemp;
314314
315315 vIsNeg := Ord (FData[J+1 ] <> ' -' );
316- aTemp := (Ord(FData[aEnd]) - c0ascii)
317- + 10 *(Ord(FData[aEnd-2 ]) - c0ascii);
318316
319- if (J+4 - vIsNeg < aEnd) then begin
320- aTemp := aTemp + 100 *(Ord(FData[aEnd-3 ]) - c0ascii);
321- end ;
322- aTemp := (vIsNeg * 2 - 1 ) * aTemp;
317+ aTemp := (
318+ (Ord(FData[aEnd]) - c0ascii)
319+ + 10 *(Ord(FData[aEnd-2 ]) - c0ascii)
320+ + Ord ((J+4 - vIsNeg < aEnd)) * 100 *(Ord(FData[aEnd-3 ]) - c0ascii)
321+ ) * (vIsNeg * 2 - 1 );
322+ // if (J+4 - vIsNeg < aEnd) then begin
323+ // aTemp := aTemp
324+ // end;
325+ // aTemp := (vIsNeg * 2 - 1) * aTemp;
323326end ;
324327
325328// ---------------------------------------------------
You can’t perform that action at this time.
0 commit comments