From 752d9f350da10cd7a8658f63c82b356dc360a52c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Feb 2011 08:43:39 -0700 Subject: [PATCH] Improve performance when cleaning user categories --- src/calibre/library/database2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 8e90fe77bd..1762fd16d2 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1196,7 +1196,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): else: new_cats['.'.join(comps)] = user_cats[k] try: - self.prefs.set('user_categories', new_cats) + if new_cats != user_cats: + self.prefs.set('user_categories', new_cats) except: pass return new_cats