Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use optimised findall for simple boolean functions
In commit 4c4c94f, findall(f, A::AbstractArray{Bool}) was optimised by using a technique where A was traversed twice: Once to count the number of true elements and once to fill in the resulting vector. However, this could cause problems for arbitrary functions f: For slow f, the approach is ~2x slower. For impure f, f being called twice could cause side effects and strange issues (see issue JuliaLang#46425) With this commit, the optimised version is only dispatched to when f is ! or identity.
- Loading branch information