Use a frozenset to optimize skiplist containment checks inside
authorZac Medico <zmedico@gentoo.org>
Wed, 12 Nov 2008 18:32:38 +0000 (18:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 12 Nov 2008 18:32:38 +0000 (18:32 -0000)
NewsManager.updateItems().

svn path=/main/trunk/; revision=11862

pym/portage/news.py

index e366287bb3b668ba60cc73d445ed6577e5709ae2..9d51d8baf7a3364a10975081ec20d98b630fc722 100644 (file)
@@ -77,7 +77,7 @@ class NewsManager(object):
                news = os.listdir(path)
 
                skipfile = os.path.join(self.unread_path, "news-%s.skip" % repoid)
-               skiplist = grabfile(skipfile)
+               skiplist = frozenset(grabfile(skipfile))
                updates = []
                for itemid in news:
                        if itemid in skiplist: