From 8026d6f5ce76a4c2628001218307ce98cde7ea0f Mon Sep 17 00:00:00 2001 From: bbarnes52 Date: Thu, 25 Oct 2018 02:30:25 -0700 Subject: [PATCH] minor code cleanup (#144) --- tools/build_defs/framework.bzl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/build_defs/framework.bzl b/tools/build_defs/framework.bzl index dc291132..eea86bce 100644 --- a/tools/build_defs/framework.bzl +++ b/tools/build_defs/framework.bzl @@ -201,7 +201,7 @@ def cc_external_rule_impl(ctx, attrs): script, accepts ConfigureParameters and some other fields provided by the rule, which have been passed to create_attrs. """ - lib_name = _value(attrs.lib_name, ctx.attr.name) + lib_name = attrs.lib_name or ctx.attr.name inputs = _define_inputs(attrs) outputs = _define_outputs(ctx, attrs, lib_name) @@ -238,7 +238,7 @@ def cc_external_rule_impl(ctx, attrs): "pushd $BUILD_TMPDIR", attrs.create_configure_script(ConfigureParameters(ctx = ctx, attrs = attrs, inputs = inputs)), "\n".join(attrs.make_commands), - _value(attrs.postfix_script, ""), + attrs.postfix_script or "", # replace references to the root directory when building ($BUILD_TMPDIR) # and the root where the dependencies were installed ($EXT_BUILD_DEPS) # for the results which are in $INSTALLDIR (with placeholder) @@ -306,11 +306,6 @@ def _correct_path_variable(env): env["PATH"] = "$PATH:" + value return env -def _value(value, default_value): - if (value): - return value - return default_value - def _depset(item): if item == None: return depset()