perf: remove unnecessary calls to 'to_list' (#737)

This commit is contained in:
Matt Mackay 2024-01-29 12:43:32 -05:00 committed by GitHub
parent f0a19f5a7c
commit 59cc7058de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ CopyToDirectoryInfo = provider(
) )
def _copy_directory_toolchain_impl(ctx): def _copy_directory_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0] binary = ctx.file.bin
default_info = DefaultInfo( default_info = DefaultInfo(
files = depset([binary]), files = depset([binary]),

View File

@ -57,7 +57,7 @@ CopyToDirectoryInfo = provider(
) )
def _copy_to_directory_toolchain_impl(ctx): def _copy_to_directory_toolchain_impl(ctx):
binary = ctx.attr.bin.files.to_list()[0] binary = ctx.file.bin
default_info = DefaultInfo( default_info = DefaultInfo(
files = depset([binary]), files = depset([binary]),

View File

@ -65,7 +65,7 @@ JqInfo = provider(
) )
def _jq_toolchain_impl(ctx): 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. # Make the $(JQ_BIN) variable available in places like genrules.
# See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables # See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables

View File

@ -314,7 +314,7 @@ YqInfo = provider(
) )
def _yq_toolchain_impl(ctx): 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. # Make the $(YQ_BIN) variable available in places like genrules.
# See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables # See https://docs.bazel.build/versions/main/be/make-variables.html#custom_variables