- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
SeqLike.equals and IterableLike.sameElements efficiency
Thu, 2010-07-08, 13:24
According to my quick reading of the code, neither SeqLike.equals or IterableLike.sameElements check for "this eq that" and returning "true" before doing the work of comparing all containing elements. For large collections (especially with non-trivially-compared elements) this is a significant lost opportunity for efficiency.
Is there a reason not to perform this "eq" check?
I noticed this for SeqLike, but perhaps MapLike and elsewhere should get the same treatment as well.