nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6064cf2
)
lib/mongodb: collections do not call next when returning only one element
author
Alexandre Terrasa
<alexandre@moz-code.org>
Wed, 24 Jun 2015 23:06:24 +0000
(19:06 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 16 Oct 2015 15:12:17 +0000
(11:12 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/mongodb/mongodb.nit
patch
|
blob
|
history
diff --git
a/lib/mongodb/mongodb.nit
b/lib/mongodb/mongodb.nit
index
1e9b9bd
..
416e36b
100644
(file)
--- a/
lib/mongodb/mongodb.nit
+++ b/
lib/mongodb/mongodb.nit
@@
-604,10
+604,7
@@
class MongoCollection
assert is_alive # FIXME used to avoid segfault (so `self` isn't garbage collected to soon)
if c == null then return null
var cursor = new MongoCursor(c)
- if cursor.is_ok then
- cursor.next
- return cursor.item
- end
+ if cursor.is_ok then return cursor.item
return null
end