diff options
author | Dmitri Shuralyov <shurcooL@gmail.com> | 2014-05-10 18:06:58 -0700 |
---|---|---|
committer | Dmitri Shuralyov <shurcooL@gmail.com> | 2014-05-10 18:06:58 -0700 |
commit | b59406eadeedf4d92bae4c5f271c2fd31483fea5 (patch) | |
tree | bcc423f2b1dcac5a05b27cda079df74d7b5fff3c /src/cmd/go/list.go | |
parent | 782a4815da0d12f04071707425850c5f4cfc2234 (diff) | |
download | go-b59406eadeedf4d92bae4c5f271c2fd31483fea5.tar.gz |
cmd/go: simplify code, reduce allocations.
This is a trivial change to make use of an existing `nl` byte slice
containing a single '\n' character. It's already declared and
used in another place in this file, so it might as well be used
in the other location instead of
a new slice literal. There should be no change in behavior,
aside from potentially less allocations.
This is my first CL, so I wanted to use a simple, hopefully non-controversial,
minor improvement to get more comfortable with golang contribution process.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/97280043
Committer: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/go/list.go')
-rw-r--r-- | src/cmd/go/list.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/list.go b/src/cmd/go/list.go index 63cd4f4f6..0ead43502 100644 --- a/src/cmd/go/list.go +++ b/src/cmd/go/list.go @@ -161,7 +161,7 @@ func runList(cmd *Command, args []string) { fatalf("%s", err) } if out.NeedNL() { - out.Write([]byte{'\n'}) + out.Write(nl) } } } |