mirror of
https://github.com/google/nomulus
synced 2026-01-08 15:21:46 +00:00
Replace iteration over depsets with an explicit .to_list() call
The old pattern did an implicit iteration over a depset which will be forbidden in the future since it is potentially expensive. The new to_list() call is still expensive but it will be more visible.
LSC: []
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221266626
This commit is contained in:
@@ -161,7 +161,7 @@ def _zip_file(ctx):
|
||||
for _, zip_path in mapped
|
||||
if "/" in zip_path
|
||||
],
|
||||
)
|
||||
).to_list()
|
||||
]
|
||||
cmd += [
|
||||
'ln -sf "${repo}/%s" "${tmp}/%s"' % (path, zip_path)
|
||||
@@ -181,7 +181,7 @@ def _zip_file(ctx):
|
||||
ctx.file_action(output = script, content = "\n".join(cmd), executable = True)
|
||||
inputs = [ctx.file._zipper]
|
||||
inputs += [dep.zip_file for dep in ctx.attr.deps]
|
||||
inputs += list(srcs)
|
||||
inputs += srcs.to_list()
|
||||
ctx.action(
|
||||
inputs = inputs,
|
||||
outputs = [ctx.outputs.out],
|
||||
|
||||
Reference in New Issue
Block a user