From 8e5dc1d23fb93b433eb38e41654df7d41293e0fa Mon Sep 17 00:00:00 2001 From: David Date: Wed, 1 Jun 2016 21:49:34 +1000 Subject: [PATCH] Small code optimization in CSS modifying Remove a stupid double loop when adding the extra CSS to the existing stylesheets. --- src/calibre/devices/kobo/driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 57849a9394..4a70f42d68 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -2016,7 +2016,7 @@ class KOBOTOUCH(KOBO): # append all rules from kobo extra css debug_print("KoboTouch:_modify_stylesheet: Append all kobo extra css rules") - for extra_rule in [r for r in self.extra_sheet.cssRules]: + for extra_rule in self.extra_sheet.cssRules: sheet.insertRule(extra_rule) is_dirty = True @@ -2797,7 +2797,7 @@ class KOBOTOUCH(KOBO): try: return getattr(opts, key) except: - debug_print("KoboTouch::get_prefs - probably an extra_customization") + debug_print("KoboTouch::get_prefs - probably an extra_customization:", key) return None @classmethod