learning scala someElements

The Scala collections library provides specialised implementations for Sets of fewer than 5 values (see the source).
The iterators for these implementations return elements in the order in which they were added, rather than the
consistent, hash-based ordering used for larger Sets.

Furthermore, sameElements (scaladoc) is defined on Iterables (it is implemented in IterableLike - see the source);
it returns true only if the iterators return the same elements in the same order.

 

posted @ 2019-08-14 14:58  嵌入式实操  阅读(149)  评论(0编辑  收藏  举报