simplex

Changeset

24:2f90a4757a8f
2011-10-03 Paul Boddie raw files shortlog changelog graph Support the immediate retrieval of an indexed record.
simplex/__init__.py (file)
     1.1 --- a/simplex/__init__.py	Mon Oct 03 01:23:42 2011 +0200
     1.2 +++ b/simplex/__init__.py	Mon Oct 03 01:36:55 2011 +0200
     1.3 @@ -69,7 +69,11 @@
     1.4          found, pos = l[i]
     1.5  
     1.6      reader.seek(pos)
     1.7 -    return find_in_file(reader, get_key, term)
     1.8 +
     1.9 +    if found == term:
    1.10 +        return reader.next()
    1.11 +    else:
    1.12 +        return find_in_file(reader, get_key, term)
    1.13  
    1.14  def find_in_file(reader, get_key, term):
    1.15