gn2bp: clean up loop

Using enumerate makes the for loop slightly cleaner.

Test: //base:base
Change-Id: Iaab33c4cf3708f4c157750a4c8f7b14d52ee7ea7
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index dd9adee..9ba1c80 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -670,9 +670,9 @@
   if target.script == "//build/write_buildflag_header.py":
     # write_buildflag_header.py writes result to args.genDir/args.output
     # So, override args.genDir by '.' so that args.output=$(out) works
-    for i in range(len(target.args)-1):
-      if target.args[i] == '--gen-dir':
-        target.args[i+1] = '.'
+    for i, val in enumerate(target.args):
+      if val == '--gen-dir':
+        target.args[i + 1] = '.'
         break
 
 def create_action_module(blueprint, target):