If I run these against [1, 2, 3], and the predicat...
# intellij
s
If I run these against [1, 2, 3], and the predicate is { it > 2 }, then the first version returns false (1 is not greater than 2), but the second returns true (3 is greater than 2)?
c
Youre absolutely right, sounds like a bug, please file it on Youtrack. Sorry I misread your code the first time I looked at it.
s
No worries; will do ๐Ÿ™‚
c
Arguably more readable way to write it (what IJ should've suggested instead of this incorrect fix):
Copy code
elements.all(predicate)
Actually
all
does exactly what your code does ๐Ÿ˜„ That's probably what you've been testing ๐Ÿ™‚
s
Haha, yep, exactly, just playing with the source when I noticed that
First time filing, let me know if anything should be changed ๐Ÿ™‚ Thanks!
c
Project should've been Kotlin, not IntelliJ, and your gif would've been helpful to include, otherwise looks good. Don't worry though, JB team will fix the project ๐Ÿ™‚
s
Ah, good to know; added the GIF. Thanks ๐Ÿ™‚
๐Ÿ˜‰ 1