Split PORTAGE_ELOG_CLASSES outside the loop for better efficiency.
authorZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 02:51:58 +0000 (02:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 02:51:58 +0000 (02:51 -0000)
svn path=/main/trunk/; revision=5495

pym/portage.py

index 4fdafbd0d3a51a3f980f2ec47601227c7f512161..68df71e47719f3c7bb657131a6be7352d0c8c3ac 100644 (file)
@@ -469,10 +469,11 @@ def elog_process(cpv, mysettings):
        # exploit listdir() file order so we process log entries in chronological order
        mylogfiles.reverse()
        mylogentries = {}
+       my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
        for f in mylogfiles:
                msgfunction, msgtype = f.split(".")
-               if not msgtype.upper() in mysettings["PORTAGE_ELOG_CLASSES"].split() \
-                               and not msgtype.lower() in mysettings["PORTAGE_ELOG_CLASSES"].split():
+               if msgtype.upper() not in my_elog_classes \
+                               and msgtype.lower() not in my_elog_classes:
                        continue
                if msgfunction not in portage_const.EBUILD_PHASES:
                        writemsg("!!! can't process invalid log file: %s\n" % f,