From 8580338d8c99f0167a30cdc81cf26df506bb9ba6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Mar 2011 12:25:02 -0700 Subject: [PATCH] ... --- src/calibre/library/caches.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index f27e15a74b..21a2622f33 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -7,7 +7,7 @@ __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' import re, itertools, time, traceback -from itertools import repeat +from itertools import repeat, izip, imap from datetime import timedelta from threading import Thread @@ -792,9 +792,8 @@ class ResultCache(SearchQueryParser): # {{{ self.marked_ids_dict = dict.fromkeys(id_dict, u'true') else: # Ensure that all the items in the dict are text - self.marked_ids_dict = {} - for id_, val in id_dict.iteritems(): - self.marked_ids_dict[id_] = unicode(val) + self.marked_ids_dict = dict(izip(id_dict.iterkeys(), imap(unicode, + id_dict.itervalues()))) # Set the values in the cache marked_col = self.FIELD_MAP['marked']