From e13280fbd29dd0b349794890c1d5ddf6e332042a Mon Sep 17 00:00:00 2001 From: tomlu Date: Fri, 11 Aug 2017 19:47:42 +0200 Subject: Use CustomCommandLine.Builder in SpawnAction always. This takes advantage of CustomCommandLine's ability to defer argument expansion. I can't think of any situation where this would be inferior, at it also cleans up the code a little. After the execution phase when Artifact strings will have been prodded and interned, I expect the memory difference to be less pronounced. PiperOrigin-RevId: 164996323 --- .../devtools/build/lib/analysis/actions/CustomCommandLine.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java index 83adf2e6ac..9ef6545700 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java @@ -605,12 +605,22 @@ public final class CustomCommandLine extends CommandLine { public CustomCommandLine build() { return new CustomCommandLine(arguments); } + + public boolean isEmpty() { + return arguments.isEmpty(); + } } public static Builder builder() { return new Builder(); } + public static Builder builder(Builder other) { + Builder builder = new Builder(); + builder.arguments.addAll(other.arguments); + return builder; + } + private final ImmutableList arguments; /** -- cgit v1.2.3