Skip to content

Commit 850b1fb

Browse files
make checkbounds(string, ...) return nothing or error
fix #24840 all the way, already mostly fixed by #24999
1 parent 5a2ef5f commit 850b1fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/strings/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ checkbounds(::Type{Bool}, s::AbstractString, I::AbstractArray{<:Real}) =
178178
checkbounds(::Type{Bool}, s::AbstractString, I::AbstractArray{<:Integer}) =
179179
all(i -> checkbounds(s, i), I)
180180
checkbounds(s::AbstractString, I::Union{Integer,AbstractArray}) =
181-
checkbounds(Bool, s, I) || throw(BoundsError(s, I))
181+
checkbounds(Bool, s, I) ? nothing : throw(BoundsError(s, I))
182182

183183
## construction, conversion, promotion ##
184184

0 commit comments

Comments
 (0)