]> Cypherpunks repositories - gostls13.git/commitdiff
internal/runtime/maps: simplify emptyOrDeleted condition
authorKeith Randall <khr@golang.org>
Fri, 25 Oct 2024 20:58:44 +0000 (13:58 -0700)
committerKeith Randall <khr@golang.org>
Fri, 1 Nov 2024 20:09:34 +0000 (20:09 +0000)
Change-Id: I37e5bba9cd62b2d970754ac24da7e1397ef12fd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/622076
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/internal/runtime/maps/group.go

index dab98cd4ff468aad223b9508559e46c13d98a782..48527629ae1afb6c29c733a4264a6b9b88ac1151 100644 (file)
@@ -119,9 +119,9 @@ func (g ctrlGroup) matchEmptyOrDeleted() bitset {
        // A deleted slot is 1111 1110
        // A full slot is    0??? ????
        //
-       // A slot is empty or deleted iff bit 7 is set and bit 0 is not.
+       // A slot is empty or deleted iff bit 7 is set.
        v := uint64(g)
-       return bitset((v &^ (v << 7)) & bitsetMSB)
+       return bitset(v & bitsetMSB)
 }
 
 // convertNonFullToEmptyAndFullToDeleted converts deleted control bytes in a