Skip to content

Commit

Permalink
improve minor inferrabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Sep 7, 2021
1 parent d0d895e commit a72d73d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions base/shell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ function shell_parse(str::AbstractString, interpolate::Bool=true;
in_double_quotes = !in_double_quotes
i = consume_upto!(arg, s, i, j)
elseif !in_single_quotes && c == '\\'
if !isempty(st) && peek(st)[2] in ('\n', '\r')
if !isempty(st) && (peek(st)::Pair{Int,Char})[2] in ('\n', '\r')
i = consume_upto!(arg, s, i, j) + 1
if popfirst!(st)[2] == '\r' && peek(st)[2] == '\n'
if popfirst!(st)[2] == '\r' && (peek(st)::Pair{Int,Char})[2] == '\n'
i += 1
popfirst!(st)
end
while !isempty(st) && peek(st)[2] in (' ', '\t')
while !isempty(st) && (peek(st)::Pair{Int,Char})[2] in (' ', '\t')
i = nextind(str, i)
_ = popfirst!(st)
end
elseif in_double_quotes
isempty(st) && error("unterminated double quote")
k, c′ = peek(st)
k, c′ = peek(st)::Pair{Int,Char}
if c′ == '"' || c′ == '$' || c′ == '\\'
i = consume_upto!(arg, s, i, j)
_ = popfirst!(st)
Expand Down
2 changes: 1 addition & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ function iterate(g::GraphemeIterator, i_=(Int32(0),firstindex(g.s)))
y === nothing && return nothing
c0, k = y
while k <= ncodeunits(s) # loop until next grapheme is s[i:j]
c, ℓ = iterate(s, k)
c, ℓ = iterate(s, k)::NTuple{2,Any}
isgraphemebreak!(state, c0, c) && break
j = k
k =
Expand Down

0 comments on commit a72d73d

Please sign in to comment.