Skip to content

Commit

Permalink
Fix bug in batDynArray.filter and filter_map
Browse files Browse the repository at this point in the history
  • Loading branch information
thelema committed Jul 6, 2010
1 parent 95065c5 commit a708a7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/batDynArray.ml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ let filter f d =
incr p;
end;
done;
changelen dest (!p-1); (* len = p-1 *)
dest.len <- !p;
changelen dest !p;
dest

let keep f d = let result = filter f d in
Expand All @@ -381,7 +382,8 @@ let filter_map f d =
incr p;
end
done;
changelen dest (!p-1); (*Trim the destination array to the right size*)
dest.len <- !p;
changelen dest !p; (*Trim the destination array to the right size*)
dest


Expand Down

0 comments on commit a708a7d

Please sign in to comment.