Skip to content

Commit bea034e

Browse files
cuishuangneild
authored andcommitted
all: remove redundant type conversion
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]>
1 parent 1e95f45 commit bea034e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bpf/vm_instructions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func jumpIfCommon(cond JumpTest, skipTrue, skipFalse uint8, regA uint32, value u
9494

9595
func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) {
9696
offset := int(ins.Off)
97-
size := int(ins.Size)
97+
size := ins.Size
9898

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

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

126126
return loadCommon(in, offset, size)
127127
}

context/go17.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var DeadlineExceeded = context.DeadlineExceeded
3232
// call cancel as soon as the operations running in this Context complete.
3333
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
3434
ctx, f := context.WithCancel(parent)
35-
return ctx, CancelFunc(f)
35+
return ctx, f
3636
}
3737

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

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

0 commit comments

Comments
 (0)