]> Cypherpunks repositories - gostls13.git/commitdiff
sync/atomic: correct result names for Or methods
authorAustin Clements <austin@google.com>
Wed, 19 Jun 2024 02:12:35 +0000 (22:12 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 21 Jun 2024 15:46:03 +0000 (15:46 +0000)
A few of the new Or methods of the atomic types use "new" as the name
for the result value, but it actually returns the old value. Fix this
by renaming the result values to "old".

Updates #61395.

Change-Id: Ib08db9964f5dfe91929f216d50ff0c9cc891ee49
Reviewed-on: https://go-review.googlesource.com/c/go/+/593855
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
src/sync/atomic/type.go

index 7d2b6805bca85d959e63fe32725877a07b94aa49..f487cb9c5f7eaaf35ee0b5b6d02636f2b9831779 100644 (file)
@@ -156,7 +156,7 @@ func (x *Uint32) And(mask uint32) (old uint32) { return AndUint32(&x.v, mask) }
 
 // Or atomically performs a bitwise OR operation on x using the bitmask
 // provided as mask and returns the old value.
-func (x *Uint32) Or(mask uint32) (new uint32) { return OrUint32(&x.v, mask) }
+func (x *Uint32) Or(mask uint32) (old uint32) { return OrUint32(&x.v, mask) }
 
 // A Uint64 is an atomic uint64. The zero value is zero.
 type Uint64 struct {
@@ -188,7 +188,7 @@ func (x *Uint64) And(mask uint64) (old uint64) { return AndUint64(&x.v, mask) }
 
 // Or atomically performs a bitwise OR operation on x using the bitmask
 // provided as mask and returns the old value.
-func (x *Uint64) Or(mask uint64) (new uint64) { return OrUint64(&x.v, mask) }
+func (x *Uint64) Or(mask uint64) (old uint64) { return OrUint64(&x.v, mask) }
 
 // A Uintptr is an atomic uintptr. The zero value is zero.
 type Uintptr struct {