Skip to content

Commit

Permalink
all: remove redundant type conversion
Browse files Browse the repository at this point in the history
Change-Id: I37550b85567abd2f5b422e742fcea9b26fd80f2b
GitHub-Last-Rev: b2e8403
GitHub-Pull-Request: #148
Reviewed-on: https://go-review.googlesource.com/c/net/+/428937
Reviewed-by: Damien Neil <[email protected]>
Run-TryBot: Damien Neil <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
cuishuang authored and neild committed Sep 9, 2022
1 parent 1e95f45 commit bea034e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bpf/vm_instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func jumpIfCommon(cond JumpTest, skipTrue, skipFalse uint8, regA uint32, value u

func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) {
offset := int(ins.Off)
size := int(ins.Size)
size := ins.Size

return loadCommon(in, offset, size)
}
Expand All @@ -121,7 +121,7 @@ func loadExtension(ins LoadExtension, in []byte) uint32 {

func loadIndirect(ins LoadIndirect, in []byte, regX uint32) (uint32, bool) {
offset := int(ins.Off) + int(regX)
size := int(ins.Size)
size := ins.Size

return loadCommon(in, offset, size)
}
Expand Down
4 changes: 2 additions & 2 deletions context/go17.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var DeadlineExceeded = context.DeadlineExceeded
// call cancel as soon as the operations running in this Context complete.
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
ctx, f := context.WithCancel(parent)
return ctx, CancelFunc(f)
return ctx, f
}

// WithDeadline returns a copy of the parent context with the deadline adjusted
Expand All @@ -46,7 +46,7 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
// call cancel as soon as the operations running in this Context complete.
func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
ctx, f := context.WithDeadline(parent, deadline)
return ctx, CancelFunc(f)
return ctx, f
}

// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
Expand Down

0 comments on commit bea034e

Please sign in to comment.