[Piglit] [piglit][PATCH 2/2] core.py: use os.path.join instead of concatination

Dylan Baker baker.dylan.c at gmail.com
Wed Aug 28 12:04:07 PDT 2013


os.path.join is an optimized c based library and is very fast, while
concatination is interpreted and slow.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/core.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/core.py b/framework/core.py
index 661b21d..07655ab 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -476,7 +476,7 @@ class Test:
                 for test in result['subtest'].keys():
                     if serious_level(result['subtest'][test]) >= serious_level(result['result']):
                         result['result'] = result['subtest'][test]
-                json_writer.write_dict_item(path + '/' + test, result)
+                json_writer.write_dict_item(os.path.join(path, test), result)
             else:
                 json_writer.write_dict_item(path, result)
         else:
-- 
1.8.1.5



More information about the Piglit mailing list