Skip to content

Commit

Permalink
[perf] Cleanup sanitize_string
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZbarsky-at authored and jbedard committed Jun 10, 2024
1 parent f730556 commit ea9b6fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions npm/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 != ".":
Expand Down

0 comments on commit ea9b6fb

Please sign in to comment.