mirror of
https://github.com/gonum/gonum.git
synced 2025-10-07 08:01:20 +08:00
graph/internal/...: update for int64 IDs
This commit is contained in:
@@ -25,3 +25,12 @@ func same(a, b Nodes) bool {
|
||||
func intsSame(a, b Ints) bool {
|
||||
return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b))
|
||||
}
|
||||
|
||||
// int64sSame 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 unsafe to get
|
||||
// the maps' pointer values to compare.
|
||||
func int64sSame(a, b Int64s) bool {
|
||||
return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b))
|
||||
}
|
||||
|
Reference in New Issue
Block a user