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>
// 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 {