1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:26:51 -07:00

[dev.link] cmd/link: add in change missed from code review

Incorporate a change suggested by Cherry for CL 201721 that I missed
accidentally.

Change-Id: I65e6532e78888505573169e56bc4ace9a0f8c510
Reviewed-on: https://go-review.googlesource.com/c/go/+/202760
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Than McIntosh 2019-10-23 11:04:16 -04:00
parent c480d32fad
commit 4adf822fc9

View File

@ -459,7 +459,7 @@ func (relocs *Relocs) At(j int) Reloc {
// larger slice will be allocated. Final slice is returned.
func (relocs *Relocs) ReadAll(dst []Reloc) []Reloc {
if relocs.Count == 0 {
return dst
return dst[:0]
}
if cap(dst) < relocs.Count {