[Piglit] [PATCH 4/6] environment.py: replace loops in constructor with comprehensions

Dylan Baker baker.dylan.c at gmail.com
Wed Jan 22 10:38:36 PST 2014


The list comprehensions are easier to read.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/environment.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/framework/environment.py b/framework/environment.py
index c991622..f7027ba 100644
--- a/framework/environment.py
+++ b/framework/environment.py
@@ -62,10 +62,8 @@ class Environment:
 
         This code uses re.compile to rebuild the lists and set self.filter
         """
-        for each in include_filter:
-            self.filter.append(re.compile(each))
-        for each in exclude_filter:
-            self.exclude_filter.append(re.compile(each))
+        self.filter = [re.compile(x) for x in include_filter]
+        self.exclude_filter = [re.compile(x) for x in exclude_filter]
 
     def __iter__(self):
         for key, values in self.__dict__.iteritems():
-- 
1.8.5.3



More information about the Piglit mailing list