graph,graph/{encoding/dot,internal/set,topo,traverse}: remove intsets imports

This commit is contained in:
kortschak
2017-06-15 11:54:48 +09:30
committed by Dan Kortschak
parent 6143493e56
commit 619e137c2c
9 changed files with 99 additions and 74 deletions

View File

@@ -16,3 +16,12 @@ import "reflect"
func same(a, b Nodes) bool {
return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer()
}
// intsSame determines whether two sets are backed by the same store. In the
// current implementation using hash maps it makes use of the fact that
// hash maps are passed as a pointer to a runtime Hmap struct. A map is
// not seen by the runtime as a pointer though, so we use reflect to get
// the maps' pointer values to compare.
func intsSame(a, b Ints) bool {
return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer()
}