diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2012-02-23 19:54:44 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2012-02-23 19:54:44 +0000 |
commit | 5b14388ad03b2a57345f722f28f99c1f05f6d9fe (patch) | |
tree | f472afd168dc3c1e61dbb81d4d8ea610ce6bff81 /ocamldoc | |
parent | ab2f6297c706a5155411422212bfeb8ddb780925 (diff) |
refactoring the "read n bytes from a channel into a new string" idiom
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12184 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc')
-rw-r--r-- | ocamldoc/odoc_analyse.ml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml index d20cd8302..bbcfaf93d 100644 --- a/ocamldoc/odoc_analyse.ml +++ b/ocamldoc/odoc_analyse.ml @@ -73,8 +73,7 @@ let parse_file inputfile parse_fun ast_magic = let ic = open_in_bin inputfile in let is_ast_file = try - let buffer = String.create (String.length ast_magic) in - really_input ic buffer 0 (String.length ast_magic); + let buffer = Misc.input_bytes ic (String.length ast_magic) in if buffer = ast_magic then true else if String.sub buffer 0 9 = String.sub ast_magic 0 9 then raise Outdated_version |