Skip to content

Commit

Permalink
Using || rather than in to check short lists of characters (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox authored Sep 4, 2020
1 parent f2e0d46 commit 70df06e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function _parsesub_tzabbr(

if state == :simple && isletter(c)
name_end = i
elseif state == :expanded && (isletter(c) || isdigit(c) || c in ('+', '-'))
elseif state == :expanded && (isletter(c) || isdigit(c) || c === '+' || c === '-')
name_end = i
elseif state == :started && c === '<'
name_start = ii
Expand Down Expand Up @@ -205,7 +205,7 @@ function _parsesub_offset(

# Optional sign
c, ii = iterate(str, i)::Tuple{Char, Int}
if c in ('+', '-')
if c === '+' || c === '-'
coefficient = c === '-' ? -1 : 1
if ii > len
return ParseNextError("$(uppercasefirst(name)) sign ($c) is not followed by a value", str, i)
Expand Down Expand Up @@ -436,7 +436,7 @@ function _parsesub_time(

# Require time does not start with a sign.
c, ii = iterate(str, i)::Tuple{Char, Int}
if c in ('+', '-')
if c === '+' || c === '-'
return ParseNextError("$(uppercasefirst(name)) should not have a sign", str, i)
end

Expand Down

0 comments on commit 70df06e

Please sign in to comment.