Skip to content

Commit ccc1d20

Browse files
tzachyrmShaneHarvey
authored andcommitted
Slightly faster Cursor.next() (mongodb#323)
1 parent e3c58c0 commit ccc1d20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymongo/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,9 +1159,9 @@ def next(self):
11591159
"""Advance the cursor."""
11601160
if self.__empty:
11611161
raise StopIteration
1162-
db = self.__collection.database
11631162
if len(self.__data) or self._refresh():
11641163
if self.__manipulate:
1164+
db = self.__collection.database
11651165
return db._fix_outgoing(self.__data.popleft(),
11661166
self.__collection)
11671167
else:

0 commit comments

Comments
 (0)