Simplify move_nav_to_end by calling spine.index.

This commit is contained in:
Ethan Dalool 2020-02-02 19:35:46 -08:00
parent 7afb9fcb7a
commit 30ae76367f

View file

@ -1097,11 +1097,11 @@ class Epub:
return
spine = self.get_spine_order()
for (index, id) in enumerate(spine):
if id == nav:
spine.append(spine.pop(index))
break
else:
try:
index = spine.index(nav)
spine.append(spine.pop(index))
except ValueError:
spine.append(nav)
self.set_spine_order(spine)