Skip to content

Commit ee35f9f

Browse files
authored
Merge pull request #183 from joelittlejohn/patch-2
Explain that sameElements will work differently for a small set
2 parents 44504df + d2f5cff commit ee35f9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/stdlib/Iterables.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ object Iterables extends AnyFlatSpec with Matchers with org.scalaexercises.defin
174174
xs.zipWithIndex should be(List((res0, 0), (res1, res2), (res3, 2)))
175175
}
176176

177-
/** `sameElements` will return true if the two `Iterables` produce the same elements in the same order:
177+
/** `sameElements` will return true if the two `Iterables` produce the same elements in the same order. The iterator for a set created with less than 5 values will return elements in the order in which they were added, rather than the consistent, hash-based ordering used by iterators for larger Sets:
178178
*/
179179
def sameElementsIterables(res0: Boolean, res1: Boolean, res2: Boolean, res3: Boolean) = {
180180
val xs = List("Manny", "Moe", "Jack")

0 commit comments

Comments
 (0)