Simplify move_nav_to_end by calling spine.index.

master
Ethan Dalool 2020-02-02 19:35:46 -08:00
parent 7afb9fcb7a
commit 30ae76367f
1 changed files with 5 additions and 5 deletions

View File

@ -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)