# HG changeset patch # User Paul Boddie # Date 1290729854 -3600 # Node ID 489129c7f2256a5eba963581292e2aff5d1eeecf # Parent 7e79dd580a629c70c12fac3f39304098745ccfe0 Changed the from_document method to remember the current document and positions, although the positions iterator will not be reset upon repeated invocations involving the same document number. diff -r 7e79dd580a62 -r 489129c7f225 iixr/positions.py --- a/iixr/positions.py Tue Nov 23 00:22:52 2010 +0100 +++ b/iixr/positions.py Fri Nov 26 01:04:14 2010 +0100 @@ -533,11 +533,12 @@ # Return the desired document positions or None (retaining the # positions for the document immediately after). - if docnum == found_docnum: - return found_positions - elif docnum < found_docnum: + if docnum <= found_docnum: self.found_docnum, self.found_positions = found_docnum, found_positions - return None + if docnum == found_docnum: + return found_positions + elif docnum < found_docnum: + return None except StopIteration: return None