Skip to content

Commit

Permalink
cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
mdirolf committed Dec 17, 2008
1 parent f1634e7 commit 978644b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bson.sml
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,16 @@ struct
end
else
raise InternalError
and hydrateElementsHelper bytes list =
and hydrateElements bytes =
case bytes of
nil => list
nil => nil
| _ => (let
val (elementType, remainder) = getByte bytes
val (key, data) = getCString remainder
val (value, elements) = hydrateValue elementType data
in
hydrateElementsHelper elements (list @ [(key, value)])
(key, value)::(hydrateElements elements)
end)
and hydrateElements bytes = hydrateElementsHelper bytes nil
and getDocument bytes =
let
val (elements, remainder) = unwrapObject bytes
Expand Down

0 comments on commit 978644b

Please sign in to comment.