mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 09:46:56 +08:00
pkg/proc/internal/ebpf: remove redundant nil check (#3502)
From the Go specification: "1. For a nil slice, the number of iterations is 0." [1] Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -71,10 +71,8 @@ func (ctx *EBPFContext) Close() {
|
|||||||
if ctx.objs != nil {
|
if ctx.objs != nil {
|
||||||
ctx.objs.Close()
|
ctx.objs.Close()
|
||||||
}
|
}
|
||||||
if ctx.links != nil {
|
for _, l := range ctx.links {
|
||||||
for _, l := range ctx.links {
|
l.Close()
|
||||||
l.Close()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user