diff options
author | Jez Ng <me@jezng.com> | 2013-07-08 16:03:55 -0700 |
---|---|---|
committer | Jez Ng <me@jezng.com> | 2013-07-08 16:03:55 -0700 |
commit | 2d6e5509507fe12948b71214e9126a539ee71354 (patch) | |
tree | 37c8501159e0c6514dc890f0097c81d40c9298ef /emcc | |
parent | f568dd0d0171d4dbd28db28241008384027bec8a (diff) |
Use implicit range in for loops where possible.
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -522,14 +522,14 @@ if CONFIGURE_CONFIG or CMAKE_CONFIG: open(tempout, 'w').write('//\n') src = None - for i in range(len(sys.argv)): - if sys.argv[i].endswith('.c'): + for arg in sys.argv: + if arg.endswith('.c'): try: - src = open(sys.argv[i]).read() - if debug_configure: open(tempout, 'a').write('============= ' + sys.argv[i] + '\n' + src + '\n=============\n\n') + src = open(arg).read() + if debug_configure: open(tempout, 'a').write('============= ' + arg + '\n' + src + '\n=============\n\n') except: pass - if sys.argv[i].endswith('.s'): + if arg.endswith('.s'): if debug_configure: open(tempout, 'a').write('(compiling .s assembly, must use clang\n') use_js = 0 @@ -1121,9 +1121,8 @@ try: # Optimize source files if llvm_opts > 0: - for i in range(len(input_files)): - input_file = input_files[i] - if input_files[i].endswith(SOURCE_SUFFIXES): + for i, input_file in enumerate(input_files): + if input_file.endswith(SOURCE_SUFFIXES): temp_file = temp_files[i] logging.debug('optimizing %s with -O%d' % (input_file, llvm_opts)) shared.Building.llvm_opt(temp_file, llvm_opts) |