From 06e4b9e49b92438e9b3882b444b76c2eb434f6cd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 3 Apr 2010 12:04:43 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/base.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index a77554062e..69b2d67b7a 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -1181,12 +1181,6 @@ class Manifest(object): :param:`href` are `None` then the corresponding item in the return tuple will also be `None`. """ - def href_present(href): - for x in self.hrefs: - if x.lower() == href.lower(): - return True - return False - if id is not None: base = id index = 1 @@ -1197,7 +1191,8 @@ class Manifest(object): href = urlnormalize(href) base, ext = os.path.splitext(href) index = 1 - while href_present(href): + lhrefs = set([x.lower() for x in self.hrefs]) + while href.lower() in lhrefs: href = base + str(index) + ext index += 1 return id, href