You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ocaml_protoc_plugin/reader.ml
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ let[@inline] read_byte t =
36
36
v
37
37
|false -> Result.raise `Premature_end_of_input
38
38
39
+
(* TODO: Speedup by inlining read_byte by copying out offset and end_offset out of the t structure so the inner loop does not have any side-effects. The copy back the offset to t once done. *)
40
+
39
41
letread_varintt=
40
42
letopenInfix.Int64in
41
43
letrec inneraccbit=
@@ -46,7 +48,7 @@ let read_varint t =
46
48
inner acc (Int.add bit 7)
47
49
|false -> acc
48
50
in
49
-
(inner[@unrolled 10])0L0
51
+
inner 0L0
50
52
51
53
letread_varint_unboxedt= read_varint t |>Int64.to_int
0 commit comments