@@ -226,20 +226,16 @@ func WithoutNth[T comparable, Slice ~[]T](collection Slice, nths ...int) Slice {
226226 return result
227227}
228228
229- // ElementsMatch returns true if lists
230- // contain the same set of elements (including empty set).
231- //
232- // If there are duplicate elements,
233- // the number of appearances of each of them in both lists should match.
229+ // ElementsMatch returns true if lists contain the same set of elements (including empty set).
230+ // If there are duplicate elements, the number of appearances of each of them in both lists should match.
231+ // The order of elements is not checked.
234232func ElementsMatch [T comparable , Slice ~ []T ](list1 Slice , list2 Slice ) bool {
235233 return ElementsMatchBy (list1 , list2 , func (item T ) T { return item })
236234}
237235
238- // ElementsMatchBy returns true if lists
239- // contain the same set of elements' keys (including empty set).
240- //
241- // If there are duplicate keys,
242- // the number of appearances of each of them in both lists should match.
236+ // ElementsMatchBy returns true if lists contain the same set of elements' keys (including empty set).
237+ // If there are duplicate keys, the number of appearances of each of them in both lists should match.
238+ // The order of elements is not checked.
243239func ElementsMatchBy [T any , K comparable ](list1 []T , list2 []T , iteratee func (item T ) K ) bool {
244240 if len (list1 ) != len (list2 ) {
245241 return false
0 commit comments