aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objfile/xcoff.go
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2025-10-19 19:53:27 +0000
committerGopher Robot <gobot@golang.org>2025-10-21 08:13:08 -0700
commita5a249d6a64508376320bc48546a6a43aebecda7 (patch)
tree707720726df7c69b68536f55154a5fb0c2704763 /src/cmd/internal/objfile/xcoff.go
parent694182d77b1a0e3676214ad0e361bdbdafde33a1 (diff)
downloadgo-a5a249d6a64508376320bc48546a6a43aebecda7.tar.xz
all: eliminate unnecessary type conversions
Found by github.com/mdempsky/unconvert Change-Id: I88ce10390a49ba768a4deaa0df9057c93c1164de GitHub-Last-Rev: 3b0f7e8f74f58340637f33287c238765856b2483 GitHub-Pull-Request: golang/go#75974 Reviewed-on: https://go-review.googlesource.com/c/go/+/712940 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/internal/objfile/xcoff.go')
-rw-r--r--src/cmd/internal/objfile/xcoff.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/internal/objfile/xcoff.go b/src/cmd/internal/objfile/xcoff.go
index d6df4db8f0..24f42760c9 100644
--- a/src/cmd/internal/objfile/xcoff.go
+++ b/src/cmd/internal/objfile/xcoff.go
@@ -44,7 +44,7 @@ func (f *xcoffFile) symbols() ([]Sym, error) {
case N_DEBUG:
sym.Code = '?'
default:
- if s.SectionNumber < 0 || len(f.xcoff.Sections) < int(s.SectionNumber) {
+ if s.SectionNumber < 0 || len(f.xcoff.Sections) < s.SectionNumber {
return nil, fmt.Errorf("invalid section number in symbol table")
}
sect := f.xcoff.Sections[s.SectionNumber-1]
@@ -116,7 +116,7 @@ func findXCOFFSymbol(f *xcoff.File, name string) (*xcoff.Symbol, error) {
if s.SectionNumber <= 0 {
return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber)
}
- if len(f.Sections) < int(s.SectionNumber) {
+ if len(f.Sections) < s.SectionNumber {
return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections))
}
return s, nil