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

Dylan Baker baker.dylan.c at gmail.com
Wed Dec 18 13:58:19 PST 2013


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 50cbd43..c5693cc 100644
--- a/framework/environment.py
+++ b/framework/environment.py
@@ -66,10 +66,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.1



More information about the Piglit mailing list