Skip to content

Commit f8b47ef

Browse files
committed
NFC: Improve length(EXPR) code
1 parent 6a9104a commit f8b47ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/spec.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ end
280280
function Base.length(x::EXPR)
281281
headof(x) === :NONSTDIDENTIFIER && return 0
282282
headof(x) === :flatten && return length(Iterating._flatten_lhs(x))
283-
n = x.args isa Nothing ? 0 : length(x.args)
284-
n += x.trivia !== nothing ? length(x.trivia) : 0
283+
n = x.args === nothing ? 0 : length(x.args)
284+
n += x.trivia === nothing ? 0 : length(x.trivia)
285285
x.head isa EXPR && !(x.head.span === 0) && (n += 1)
286286
return n
287287
end

0 commit comments

Comments
 (0)