changeset 1294:cefcb223c892

benchmark: cleanup if-statements
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 19:12:29 +0200
parents 6952e7a560f8
children beefdf8f16c4
files apps/benchmark.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/apps/benchmark.py	Fri Oct 16 19:08:46 2009 +0200
+++ b/apps/benchmark.py	Fri Oct 16 19:12:29 2009 +0200
@@ -153,7 +153,7 @@
 
 (options, args) = parser.parse_args()
 
-if len(args) == 0:
+if not args:
     parser.error("you must specify a config file")
 
 id, players = load_config(args[0])
@@ -181,7 +181,7 @@
 
 # Identify the additional mixins.
 actual_mixins = []
-if options.mixins != "":
+if options.mixins:
     actual_mixins = [mixins[mixin] for mixin in options.mixins.split(',')]
 
 
@@ -203,7 +203,7 @@
 
 def update_args(runtime, options):
     args = {}
-    if options.args != "":
+    if options.args:
         for arg in options.args.split(','):
             id, value = arg.split('=')
             args[id] = long(value)
@@ -219,13 +219,13 @@
     benchmark = SequentialBenchmark
 
 needed_data = ""
-if options.needed_data != "":
+if options.needed_data:
     file = open(options.needed_data, 'r')
     for l in file:
         needed_data += l
     needed_data = eval(needed_data)
 
-if options.needed_data != "" and options.pc != "":
+if options.needed_data and options.pc:
     bases = (benchmark, NeededDataBenchmarkStrategy, operation_arity, object)
     options.pc = eval(options.pc)
 else: