Skip to content

Commit

Permalink
perf: remove unnecessary calls to 'to_list' (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattem authored Jan 29, 2024
1 parent f0a19f5 commit 59cc705
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/private/copy_directory_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ CopyToDirectoryInfo = provider(
)

def _copy_directory_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0]
binary = ctx.file.bin

default_info = DefaultInfo(
files = depset([binary]),
Expand Down
2 changes: 1 addition & 1 deletion lib/private/copy_to_directory_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ CopyToDirectoryInfo = provider(
)

def _copy_to_directory_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0]
binary = ctx.file.bin

default_info = DefaultInfo(
files = depset([binary]),
Expand Down
2 changes: 1 addition & 1 deletion lib/private/jq_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ JqInfo = provider(
)

def _jq_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0]
binary = ctx.file.bin

# Make the $(JQ_BIN) variable available in places like genrules.
# See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables
Expand Down
2 changes: 1 addition & 1 deletion lib/private/yq_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ YqInfo = provider(
)

def _yq_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0]
binary = ctx.file.bin

# Make the $(YQ_BIN) variable available in places like genrules.
# See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables
Expand Down

0 comments on commit 59cc705

Please sign in to comment.