Skip to content

Commit d0060e7

Browse files
authored
Add propagate_inbounds to some SubString operations (#59615)
1 parent cb8734a commit d0060e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/strings/substring.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ function isvalid(s::SubString, i::Integer)
109109
@inbounds return ib && isvalid(s.string, s.offset + i)::Bool
110110
end
111111

112-
thisind(s::SubString{String}, i::Int) = _thisind_str(s, i)
113-
nextind(s::SubString{String}, i::Int) = _nextind_str(s, i)
112+
@propagate_inbounds thisind(s::SubString{String}, i::Int) = _thisind_str(s, i)
113+
@propagate_inbounds nextind(s::SubString{String}, i::Int) = _nextind_str(s, i)
114114

115115
parent(s::SubString) = s.string
116116
parentindices(s::SubString) = (s.offset + 1 : thisind(s.string, s.offset + s.ncodeunits),)

0 commit comments

Comments
 (0)