[dev.link] cmd/link: unify Relocs.Count and len(rs)

The Count field in Relocs type is always equal to len(rs). Unify
them.

Change-Id: Ic77288ea58b61a98482b218e051d81047d0ddd88
Reviewed-on: https://go-review.googlesource.com/c/go/+/226717
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Cherry Zhang 2020-03-30 10:04:00 -04:00
parent 6e3bde5f30
commit 0e0ee115c5
9 changed files with 29 additions and 33 deletions

View file

@ -209,10 +209,10 @@ func TestAddMaterializedSymbol(t *testing.T) {
}
func sameRelocSlice(s1 *Relocs, s2 []Reloc) bool {
if s1.Count != len(s2) {
if s1.Count() != len(s2) {
return false
}
for i := 0; i < s1.Count; i++ {
for i := 0; i < s1.Count(); i++ {
r1 := s1.At2(i)
r2 := &s2[i]
if r1.Sym() != r2.Sym ||