let index_out_of_bounds () = invalid_arg "index out of bounds"
let put (data, off, len) n v =
- if n < 0 || off+n >= len then index_out_of_bounds ()
+ if n < 0 || n >= len then index_out_of_bounds ()
else (
let i = off+n in
let si = i lsr 3 and mask = 0x80 lsr (i land 7) in
let clear bits n = put bits n 0
let get (data, off, len) n =
- if n < 0 || off+n >= len then index_out_of_bounds ()
+ if n < 0 || n >= len then index_out_of_bounds ()
else (
let i = off+n in
let si = i lsr 3 and mask = 0x80 lsr (i land 7) in