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
Original bug ID: 1578 Reporter: administrator Status: closed (set by @xavierleroy on 2013-08-31T10:46:12Z) Resolution: suspended Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Eric Cooper
Version: 3.06
OS: linux
Submission from: 12-227-100-158.client.attbi.com (12.227.100.158)
Please add the function
val add_byte : t -> int -> unit
to the Buffer module, where (add_byte buf n) is equivalent to
(add_char buf (Char.chr n)), but hopefully more efficient.
I wouldn't mind if only the low 8 bits of n are stored, using %string_safe_set.
Thanks for considering this.
The text was updated successfully, but these errors were encountered:
The cost of Char.chr is only two comparisons with constants, so it is probably not worth the trouble of using %string_safe_set (which is not documented to truncate its input).
Whatever the implementation, do we want to provide add_byte in buffer.mli? There doesn't seem to be much demand for it.
Original bug ID: 1578
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-31T10:46:12Z)
Resolution: suspended
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Eric Cooper
Version: 3.06
OS: linux
Submission from: 12-227-100-158.client.attbi.com (12.227.100.158)
Please add the function
to the Buffer module, where (add_byte buf n) is equivalent to
(add_char buf (Char.chr n)), but hopefully more efficient.
I wouldn't mind if only the low 8 bits of n are stored, using %string_safe_set.
Thanks for considering this.
The text was updated successfully, but these errors were encountered: