Skip to content

Commit 6b0037f

Browse files
committed
stronger assertions
1 parent bac352d commit 6b0037f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/strings/basic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ function prevind(s::AbstractString, i::Int, n::Int)
514514
while n > 0 && 1 < i
515515
@inbounds n -= isvalid(s, i -= 1)
516516
end
517-
return (i - n)::Int
517+
return i::Int - n::Int
518518
end
519519

520520
"""
@@ -573,7 +573,7 @@ function nextind(s::AbstractString, i::Int, n::Int)
573573
while n > 0 && i < z
574574
@inbounds n -= isvalid(s, i += 1)
575575
end
576-
return (i + n)::Int
576+
return i::Int + n::Int
577577
end
578578

579579
## string index iteration type ##

0 commit comments

Comments
 (0)