diff options
author | Dean Deng <deandeng@google.com> | 2019-12-16 14:40:01 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-16 14:41:20 -0800 |
commit | 3193b2fff8149fe43a3a59c266359e7f443a1563 (patch) | |
tree | d018b675b785815b3c7aa485e577c42b12b1ee50 /pkg/sentry/strace | |
parent | e6f4124afd951c3b089f9c75c499c14f4d90a590 (diff) |
Drop unnecessary cast.
Bitshift operators with signed int is supported in Go 1.13.
PiperOrigin-RevId: 285853622
Diffstat (limited to 'pkg/sentry/strace')
-rw-r--r-- | pkg/sentry/strace/select.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/strace/select.go b/pkg/sentry/strace/select.go index 92c18083d..dea309fda 100644 --- a/pkg/sentry/strace/select.go +++ b/pkg/sentry/strace/select.go @@ -27,7 +27,7 @@ func fdsFromSet(t *kernel.Task, set []byte) []int { // Append n if the n-th bit is 1. for i, v := range set { for j := 0; j < 8; j++ { - if (v>>uint(j))&1 == 1 { + if (v>>j)&1 == 1 { fds = append(fds, i*8+j) } } @@ -42,7 +42,7 @@ func fdSet(t *kernel.Task, nfds int, addr usermem.Addr) string { // Calculate the size of the fd set (one bit per fd). nBytes := (nfds + 7) / 8 - nBitsInLastPartialByte := uint(nfds % 8) + nBitsInLastPartialByte := nfds % 8 set, err := linux.CopyInFDSet(t, addr, nBytes, nBitsInLastPartialByte) if err != nil { |