- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
a word of explanation on r20607
Wed, 2010-01-20, 01:40
I picked through every use of .zipped.forall in trunk and to my eye,
every single one of them should in principle include a length check.
About half of them actually had one. It's likely that in most or all
cases, an explicit length check would be redundant because something
somewhere would already have caught mismatched lists: but given the
implementation of corresponds, it can only be beneficial to have the
length check in place (for intention-documentation if nothing else.)
To be extra careful, I did a build where I logged it if corresponds
would ever give a different answer than zipped.forall. This happened
zero times, so I think it is all safe. To make it easy to review the
spots where the length check was introduced, I commented them:
// @PP: corresponds
with the intention of deleting all those after you've had a chance to
confirm it's all cool.