Simplify move_nav_to_end by calling spine.index.
This commit is contained in:
parent
7afb9fcb7a
commit
30ae76367f
1 changed files with 5 additions and 5 deletions
|
@ -1097,11 +1097,11 @@ class Epub:
|
|||
return
|
||||
|
||||
spine = self.get_spine_order()
|
||||
for (index, id) in enumerate(spine):
|
||||
if id == nav:
|
||||
|
||||
try:
|
||||
index = spine.index(nav)
|
||||
spine.append(spine.pop(index))
|
||||
break
|
||||
else:
|
||||
except ValueError:
|
||||
spine.append(nav)
|
||||
|
||||
self.set_spine_order(spine)
|
||||
|
|
Loading…
Reference in a new issue