Skip to content

Commit 2941f53

Browse files
authored
Remove as_list/as_iterable usage from go_path (#4059)
**What type of PR is this?** Starlark cleanup **What does this PR do? Why is it needed?** These methods obscure the types of vars and are slower than just calling the underlying function **Which issues(s) does this PR fix?** Fixes # **Other notes for review**
1 parent e51bc8d commit 2941f53

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

go/private/tools/path.bzl

+3-8
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ load(
1616
"@bazel_skylib//lib:paths.bzl",
1717
"paths",
1818
)
19-
load(
20-
"//go/private:common.bzl",
21-
"as_iterable",
22-
"as_list",
23-
)
2419
load(
2520
"//go/private:providers.bzl",
2621
"GoArchive",
@@ -50,16 +45,16 @@ def _go_path_impl(ctx):
5045
# Collect sources and data files from archives. Merge archives into packages.
5146
pkg_map = {} # map from package path to structs
5247
for mode, archives in mode_to_archive.items():
53-
for archive in as_iterable(archives):
48+
for archive in archives.to_list():
5449
importpath, pkgpath = effective_importpath_pkgpath(archive)
5550
if importpath == "":
5651
continue # synthetic archive or inferred location
5752
pkg = struct(
5853
importpath = importpath,
5954
dir = "src/" + pkgpath,
60-
srcs = as_list(archive.srcs),
55+
srcs = list(archive.srcs),
6156
runfiles = archive.runfiles,
62-
embedsrcs = as_list(archive._embedsrcs),
57+
embedsrcs = list(archive._embedsrcs),
6358
pkgs = {mode: archive.file},
6459
)
6560
if pkgpath in pkg_map:

0 commit comments

Comments
 (0)