mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-11 21:49:13 +00:00
Transitive closure virtual table.
This commit is contained in:
12
internal/util/set.go
Normal file
12
internal/util/set.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package util
|
||||
|
||||
type Set[E comparable] map[E]struct{}
|
||||
|
||||
func (s Set[E]) Add(v E) {
|
||||
s[v] = struct{}{}
|
||||
}
|
||||
|
||||
func (s Set[E]) Contains(v E) bool {
|
||||
_, ok := s[v]
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user