We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58c5404 commit 9a4b273Copy full SHA for 9a4b273
1 file changed
src/ocaml_protoc_plugin/serialize.ml
@@ -182,12 +182,13 @@ let%expect_test "zigzag encoding" =
182
let test_values =
183
[Int64.min_int; n2l Int.min_int; i2l Int32.min_int; -2L;
184
0L; 3L; i2l Int32.max_int; n2l Int.max_int; Int64.max_int]
185
- |> List.concat_map ~f:(
+ |> List.map ~f:(
186
let open Infix.Int64 in
187
function
188
| v when v > 0L -> [pred v; v]
189
| v -> [v; succ v]
190
)
191
+ |> List.concat
192
in
193
List.iter ~f:(fun vl -> Printf.printf "zigzag_encoding 0x%016Lx = 0x%016Lx\n" vl (encode_zigzag vl)) test_values;
194
List.iter ~f:(fun v -> Printf.printf "zigzag_encoding_unboxed 0x%016x = 0x%016x\n" (Int64.to_int v) (Int64.to_int v |> encode_zigzag_unboxed)) test_values;
0 commit comments