]> Cypherpunks repositories - gostls13.git/commitdiff
debug/buildinfo: remove redundant type conversion
authorSasha Melentyev <sasha@melentyev.io>
Sat, 3 Sep 2022 20:08:12 +0000 (20:08 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 6 Sep 2022 16:59:51 +0000 (16:59 +0000)
Change-Id: Ia8ffc9a17646ad2c74f633610aaf34fef006c023
GitHub-Last-Rev: 6ab0d107393c9bdfeaed5c539efb452942c00394
GitHub-Pull-Request: golang/go#54856
Reviewed-on: https://go-review.googlesource.com/c/go/+/428235
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/debug/buildinfo/buildinfo.go

index 3dbe3fe41def289c3d7ee7b65332c9d226e325ed..ef77f28ce59aba5acedf785176de6790c0178a26 100644 (file)
@@ -394,13 +394,13 @@ type xcoffExe struct {
 
 func (x *xcoffExe) ReadData(addr, size uint64) ([]byte, error) {
        for _, sect := range x.f.Sections {
-               if uint64(sect.VirtualAddress) <= addr && addr <= uint64(sect.VirtualAddress+sect.Size-1) {
-                       n := uint64(sect.VirtualAddress+sect.Size) - addr
+               if sect.VirtualAddress <= addr && addr <= sect.VirtualAddress+sect.Size-1 {
+                       n := sect.VirtualAddress + sect.Size - addr
                        if n > size {
                                n = size
                        }
                        data := make([]byte, n)
-                       _, err := sect.ReadAt(data, int64(addr-uint64(sect.VirtualAddress)))
+                       _, err := sect.ReadAt(data, int64(addr-sect.VirtualAddress))
                        if err != nil {
                                return nil, err
                        }