mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
all: use &^ operator if possible
This is a change improving consistency in the source tree. The pattern foo &= ^bar, was only used six times in src/ directory. The usage of the supported &^ (bit clear / AND NOT) operator is way more common, about factor 10x. Change-Id: If26a2994fd81d23d42189bee00245eb84e672cf3 Reviewed-on: https://go-review.googlesource.com/21224 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d733cef728
commit
d0fb649713
5 changed files with 6 additions and 6 deletions
|
|
@ -103,7 +103,7 @@ func SetNonblock(fd int, nonblocking bool) (err error) {
|
|||
if nonblocking {
|
||||
flag |= O_NONBLOCK
|
||||
} else {
|
||||
flag &= ^O_NONBLOCK
|
||||
flag &^= O_NONBLOCK
|
||||
}
|
||||
_, err = fcntl(fd, F_SETFL, flag)
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue