mirror of
https://github.com/hashicorp/terraform.git
synced 2026-03-21 18:10:30 -04:00
21 lines
332 B
Go
21 lines
332 B
Go
// Copyright IBM Corp. 2014, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package promising
|
|
|
|
type ptrSet[T any] map[*T]struct{}
|
|
|
|
func (s ptrSet[T]) Add(p *T) {
|
|
s[p] = struct{}{}
|
|
}
|
|
|
|
func (s ptrSet[T]) Remove(p *T) {
|
|
delete(s, p)
|
|
}
|
|
|
|
func (s ptrSet[T]) Has(p *T) bool {
|
|
_, ret := s[p]
|
|
return ret
|
|
}
|
|
|
|
type promiseSet = ptrSet[promise]
|