aboutsummaryrefslogtreecommitdiff
path: root/commitquery/query_set_clear_marks.go
blob: b961933889a35e52f4b0212b96de5308844dc9d9 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package commitquery

// setMarks ORs one set of mark bits into one internal node.
func (query *query) setMarks(idx nodeIndex, bits markBits) {
	newBits := bits &^ query.nodes[idx].marks
	if newBits == 0 {
		return
	}

	query.trackTouched(idx)
	query.nodes[idx].marks |= bits
}

// clearMarks removes one set of mark bits from one internal node.
func (query *query) clearMarks(idx nodeIndex, bits markBits) {
	if query.nodes[idx].marks&bits == 0 {
		return
	}

	query.trackTouched(idx)
	query.nodes[idx].marks &^= bits
}