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 return
spine = self.get_spine_order() spine = self.get_spine_order()
for (index, id) in enumerate(spine):
if id == nav: try:
index = spine.index(nav)
spine.append(spine.pop(index)) spine.append(spine.pop(index))
break except ValueError:
else:
spine.append(nav) spine.append(nav)
self.set_spine_order(spine) self.set_spine_order(spine)