Skip to content

Commit 30b8419

Browse files
committed
tweak inbounds usage
1 parent 6f5b0dc commit 30b8419

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

base/strings/search.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ function findnext(testf::Function, s::AbstractString, i::Integer)
130130
1 i z || throw(BoundsError(s, i))
131131
@inbounds i == z || isvalid(s, i) || string_index_err(s, i)
132132
e = lastindex(s)
133-
@inbounds while i <= e
134-
testf(s[i]) && return i
135-
i = nextind(s, i)
133+
while i <= e
134+
testf(@inbounds s[i]) && return i
135+
i = @inbounds nextind(s, i)
136136
end
137137
return nothing
138138
end
@@ -340,9 +340,9 @@ function findprev(testf::Function, s::AbstractString, i::Integer)
340340
0 i z || throw(BoundsError(s, i))
341341
i == z && return nothing
342342
@inbounds i == 0 || isvalid(s, i) || string_index_err(s, i)
343-
@inbounds while i >= 1
344-
testf(s[i]) && return i
345-
i = prevind(s, i)
343+
while i >= 1
344+
testf(@inbounds s[i]) && return i
345+
i = @inbounds prevind(s, i)
346346
end
347347
return nothing
348348
end

0 commit comments

Comments
 (0)