Skip to content

Commit

Permalink
runtime: remove useless nil checking during init of itab
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezzno J committed Nov 14, 2023
1 parent dd88f23 commit d3d4d4c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/runtime/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,11 @@ imethods:
pkgPath = rtyp.nameOff(x.PkgPath).Name()
}
if tname.IsExported() || pkgPath == ipkg {
if m != nil {
ifn := rtyp.textOff(t.Ifn)
if k == 0 {
fun0 = ifn // we'll set m.fun[0] at the end
} else {
methods[k] = ifn
}
ifn := rtyp.textOff(t.Ifn)
if k == 0 {
fun0 = ifn // we'll set m.fun[0] at the end
} else {
methods[k] = ifn
}
continue imethods
}
Expand Down

0 comments on commit d3d4d4c

Please sign in to comment.