mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +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,12 +71,10 @@ 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() | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| } |  | ||||||
|  |  | ||||||
| func (ctx *EBPFContext) AttachUprobe(pid int, name string, offset uint64) error { | func (ctx *EBPFContext) AttachUprobe(pid int, name string, offset uint64) error { | ||||||
| 	if ctx.executable == nil { | 	if ctx.executable == nil { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Eng Zer Jun
					Eng Zer Jun