Skip to content

Commit 7e98944

Browse files
panjf2000tklauser
authored andcommitted
internal/poll: eliminate the redundant conditional branch for isKernelVersionGE53
Follow up CL 573755 Change-Id: I27c7571d3ef1274cf2c6892e678f946f9b65de33 Reviewed-on: https://go-review.googlesource.com/c/go/+/576416 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Tobias Klauser <[email protected]>
1 parent ebf7747 commit 7e98944

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/internal/poll/copy_file_range_linux.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ var isKernelVersionGE53 = sync.OnceValue(func() bool {
1515
// copy_file_range(2) is broken in various ways on kernels older than 5.3,
1616
// see https://go.dev/issue/42400 and
1717
// https://man7.org/linux/man-pages/man2/copy_file_range.2.html#VERSIONS
18-
if major > 5 || (major == 5 && minor >= 3) {
19-
return true
20-
}
21-
return false
18+
return major > 5 || (major == 5 && minor >= 3)
2219
})
2320

2421
const maxCopyFileRangeRound = 1 << 30

0 commit comments

Comments
 (0)