This commit is contained in:
Gordon
2022-04-08 17:55:44 +08:00
parent a16025ca95
commit 2a0f8f5ce3
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -39,6 +39,8 @@ func cleanUpFuncName(funcName string) string {
}
return funcName[end+1:]
}
//Get the intersection of two slices
func Intersect(slice1, slice2 []uint32) []uint32 {
m := make(map[uint32]bool)
n := make([]uint32, 0)
@@ -53,6 +55,8 @@ func Intersect(slice1, slice2 []uint32) []uint32 {
}
return n
}
//Get the diff of two slices
func Difference(slice1, slice2 []uint32) []uint32 {
m := make(map[uint32]bool)
n := make([]uint32, 0)