Skip to content
Browse files

[enhance] stdlib, mongo: Cache dbset iterator

  • Loading branch information...
1 parent a7e20a6 commit fece86249da33970a311207eba38f47daf991377 @BourgerieQuentin BourgerieQuentin committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/stdlib/database/mongo/db.opa
View
4 lib/stdlib/database/mongo/db.opa
@@ -890,11 +890,11 @@ DbSet = {{
{some = (opa, {next=->aux(size, dbset, i+1)})}
end
end
- {next = ->
+ Iter.cache({next = ->
nb = MongoCommon.reply_numberReturned(dbset.reply)
nb = if dbset.limit != 0 then min(nb, dbset.limit) else nb
if nb == 0 then none
- else aux(nb, dbset, 0)}
+ else aux(nb, dbset, 0)})
@private fold(init, dbset, f) =
Iter.fold(f, iterator(dbset), init)

0 comments on commit fece862

Please sign in to comment.
Something went wrong with that request. Please try again.