From ea9b6fb22ee167d7391e8990bf5289f2862486f5 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Mon, 10 Jun 2024 13:11:37 -0400 Subject: [PATCH] [perf] Cleanup sanitize_string --- npm/private/utils.bzl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/npm/private/utils.bzl b/npm/private/utils.bzl index b215403fb..cb73b23cf 100644 --- a/npm/private/utils.bzl +++ b/npm/private/utils.bzl @@ -20,8 +20,7 @@ def _sorted_map(m): def _sanitize_string(string): # Workspace names may contain only A-Z, a-z, 0-9, '-', '_' and '.' result = "" - for i in range(0, len(string)): - c = string[i] + for c in string.elems(): if c == "@" and (not result or result[-1] == "_"): result += "at" if not c.isalnum() and c != "-" and c != "_" and c != ".":