[Piglit] [PATCH 03/11] profile.py: Remove uses of keys, items and values as appropriate

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 25 13:27:35 PDT 2014


These methods compute and return a list in python 2, Their iter* cousins
however do not return a list, but an iterator. This has memory saving
properties.
---
 framework/profile.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/profile.py b/framework/profile.py
index 21c2747..ea37f6c 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -75,7 +75,7 @@ class TestProfile(object):
         '''
 
         def f(prefix, group, test_dict):
-            for key in group:
+            for key in group.iterkeys():
                 fullkey = key if prefix == '' else os.path.join(prefix, key)
                 if isinstance(group[key], dict):
                     f(fullkey, group[key], test_dict)
-- 
2.0.0.rc0



More information about the Piglit mailing list