You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!matchedIndexes.contains(idx) && aMatchVal == func(e)) {
valres= itemDiffer.diff(a, e)
results += res
matchedIndexes += idx
allIsOk &= res.isOk
true
} else {
false
}
}
The func passed in the default instance is identity, which results in pairs of matching elements paired by equality.
However, this amounts to a useless Differ instance unless one specifies a custom pairing function. I understand the utility of being able to specify a custom pairing function for an unordered collection but I'd also expect a reasonable default one that is smart enough to match elements that are similar, something akin to the example here: softwaremill/diffx#6 (comment)
Or alternatively, it would be better to drop the default instance.
The text was updated successfully, but these errors were encountered:
spavikevik
changed the title
Regarding pair matching functions
Regarding pair matching functions for SetDifferDec 10, 2024
Hi, thanks for the nice library! I have a small issue about the default
SetDiffer
instance which invokes the following methoddifflicious/modules/core/src/main/scala/difflicious/differ/SeqDiffer.scala
Lines 151 to 174 in f4b0c74
The
func
passed in the default instance isidentity
, which results in pairs of matching elements paired by equality.However, this amounts to a useless
Differ
instance unless one specifies a custom pairing function. I understand the utility of being able to specify a custom pairing function for an unordered collection but I'd also expect a reasonable default one that is smart enough to match elements that are similar, something akin to the example here:softwaremill/diffx#6 (comment)
Or alternatively, it would be better to drop the default instance.
The text was updated successfully, but these errors were encountered: