Skip to content

Commit

Permalink
@inbounds annotations for filter
Browse files Browse the repository at this point in the history
  • Loading branch information
andyferris authored Nov 26, 2018
1 parent 024bcb7 commit d18cc8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,7 @@ julia> filter(isodd, a)
9
```
"""
filter(f, As::AbstractArray) = As[map(f, As)::AbstractArray{Bool}]
filter(f, As::AbstractArray) = @inbounds As[map(f, As)::AbstractArray{Bool}]

"""
filter!(f, a::AbstractVector)
Expand All @@ -2345,7 +2345,7 @@ function filter!(f, a::AbstractVector)

for acurr in a
if f(acurr)
a[i] = acurr
@inbounds a[i] = acurr
y = iterate(idx, state)
y === nothing && (i += 1; break)
i, state = y
Expand Down

0 comments on commit d18cc8f

Please sign in to comment.