mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
f47f4afe9f
commit
dbbde2c494
@ -500,12 +500,12 @@ class Indexer(object): # {{{
|
|||||||
continue
|
continue
|
||||||
seen.add(offset)
|
seen.add(offset)
|
||||||
index = IndexEntry(offset, label)
|
index = IndexEntry(offset, label)
|
||||||
self.indices.append(index)
|
indices.append(index)
|
||||||
|
|
||||||
indices.sort(key=lambda x:x.offset)
|
indices.sort(key=lambda x:x.offset)
|
||||||
|
|
||||||
# Set lengths
|
# Set lengths
|
||||||
for i, index in indices:
|
for i, index in enumerate(indices):
|
||||||
try:
|
try:
|
||||||
next_offset = indices[i+1].offset
|
next_offset = indices[i+1].offset
|
||||||
except:
|
except:
|
||||||
@ -516,11 +516,11 @@ class Indexer(object): # {{{
|
|||||||
indices = [i for i in indices if i.length > 0]
|
indices = [i for i in indices if i.length > 0]
|
||||||
|
|
||||||
# Set index values
|
# Set index values
|
||||||
for i, index in indices:
|
for i, index in enumerate(indices):
|
||||||
index.index = i
|
index.index = i
|
||||||
|
|
||||||
# Set lengths again to close up any gaps left by filtering
|
# Set lengths again to close up any gaps left by filtering
|
||||||
for i, index in indices:
|
for i, index in enumerate(indices):
|
||||||
try:
|
try:
|
||||||
next_offset = indices[i+1].offset
|
next_offset = indices[i+1].offset
|
||||||
except:
|
except:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user