We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef25939 commit b612ab3Copy full SHA for b612ab3
src/cmd/compile/internal/gc/bv.go
@@ -55,9 +55,7 @@ func (bv1 bvec) Eq(bv2 bvec) bool {
55
}
56
57
func (dst bvec) Copy(src bvec) {
58
- for i, x := range src.b {
59
- dst.b[i] = x
60
- }
+ copy(dst.b, src.b)
61
62
63
func (bv bvec) Get(i int32) bool {
@@ -76,6 +74,14 @@ func (bv bvec) Set(i int32) {
76
74
bv.b[i/WORDBITS] |= mask
77
75
78
+func (bv bvec) Unset(i int32) {
+ if i < 0 || i >= bv.n {
79
+ Fatalf("bvunset: index %d is out of bounds with length %d\n", i, bv.n)
80
+ }
81
+ mask := uint32(1 << uint(i%WORDBITS))
82
+ bv.b[i/WORDBITS] &^= mask
83
+}
84
+
85
// bvnext returns the smallest index >= i for which bvget(bv, i) == 1.
86
// If there is no such index, bvnext returns -1.
87
func (bv bvec) Next(i int32) int32 {
0 commit comments