From 608b3dde2c23831094ed6d61db6bfe62966943ff Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 17:01:11 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20emcc:=20Replace=20`range(len(newarg?= =?UTF-8?q?s))`=20with=20`enumerate(newargs)`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change optimizes the loop in `emcc.py`'s `separate_linker_flags` function by using the more Pythonic and slightly faster `enumerate` instead of iterating over `range(len(newargs))` and performing index lookups. Co-authored-by: sbc100 <515813+sbc100@users.noreply.github.com> --- emcc.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emcc.py b/emcc.py index a64a00eab4555..86526faa2336e 100644 --- a/emcc.py +++ b/emcc.py @@ -343,12 +343,11 @@ def add_link_arg(flag, is_file=False): linker_args.append(LinkFlag(flag, is_file)) skip = False - for i in range(len(newargs)): + for i, arg in enumerate(newargs): if skip: skip = False continue - arg = newargs[i] if arg in CLANG_FLAGS_WITH_ARGS: skip = True