Skip to content

Commit b9c09b9

Browse files
author
Arnaud Bouchez
committed
another micro-optimization
1 parent e925346 commit b9c09b9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

entries/abouchez/src/brcmormot.lpr

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,21 @@ procedure TBrcThread.Execute;
193193
if p[2] = ord('.') then // xx.x
194194
begin
195195
v := (p[0] * 100 + p[1] * 10 + p[3] - (ord('0') * 111)) * neg;
196-
inc(PByte(p), 6);
196+
inc(PByte(p), 8);
197197
end
198198
else
199199
begin
200200
v := (p[0] * 10 + p[2] - (ord('0') * 11)) * neg; // x.x
201-
inc(PByte(p), 5);
201+
inc(PByte(p), 7);
202202
end;
203+
start := PUtf8Char(p) - 2;
203204
// store the value
204205
inc(s^.Sum, v);
205206
inc(s^.Count);
206207
if v < s^.Min then
207208
s^.Min := v; // branchless cmovg/cmovl is not better
208209
if v > s^.Max then
209210
s^.Max := v;
210-
start := pointer(p);
211-
p := @p[2];
212211
until PUtf8Char(p) >= stop;
213212
end;
214213
// aggregate this thread values into the main list

0 commit comments

Comments
 (0)