diff options
| author | 2025-03-05 12:54:14 -0800 | |
|---|---|---|
| committer | 2025-03-05 12:54:14 -0800 | |
| commit | 37c26fae4032febb534e5ba88bc58cef3352261c (patch) | |
| tree | 74ff63457bff703ff2b8e405aed407a93931f06e | |
| parent | 69a16a3d2b5de7d51bb97559b5bb51e411b62fec (diff) | |
| parent | 184f51d1a1edc8d94dcc1de34e956f7b1b8678df (diff) | |
Merge "Optimize RuleBuilderCommand.Textf()" into main am: e20307b4ba am: 184f51d1a1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3528870
Change-Id: Iaf00b86f18e6e311206e4e1cca70f65892d08c35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | android/rule_builder.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android/rule_builder.go b/android/rule_builder.go index db56c3f29..ea6aaa4c4 100644 --- a/android/rule_builder.go +++ b/android/rule_builder.go @@ -1187,7 +1187,11 @@ func (c *RuleBuilderCommand) Text(text string) *RuleBuilderCommand { // Textf adds the specified formatted text to the command line. The text should not contain input or output paths or // the rule will not have them listed in its dependencies or outputs. func (c *RuleBuilderCommand) Textf(format string, a ...interface{}) *RuleBuilderCommand { - return c.Text(fmt.Sprintf(format, a...)) + if c.buf.Len() > 0 { + c.buf.WriteByte(' ') + } + fmt.Fprintf(&c.buf, format, a...) + return c } // Flag adds the specified raw text to the command line. The text should not contain input or output paths or the |