mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(slice): pass actual comparison indexes to DifferenceBy (#370)
This commit is contained in:
1 parent
59cd9bd06f
commit
34c7e36d29
2 files changed
+5
-2
No files matched your search
+2
-2
@@ -187,8 +187,8 @@ func DifferenceBy[T comparable](slice []T, comparedSlice []T, iteratee func(inde
|
||||
result := make([]T, 0)
|
||||
|
||||
comparedMap := make(map[T]struct{}, len(comparedSlice))
|
||||
for _, item := range comparedSlice {
|
||||
comparedMap[iteratee(0, item)] = struct{}{}
|
||||
for i, item := range comparedSlice {
|
||||
comparedMap[iteratee(i, item)] = struct{}{}
|
||||
}
|
||||
|
||||
for i, item := range slice {
|
||||
|
||||
Reference in new issue
Block a user