Skip to content

Commit 7bc92b7

Browse files
authored
Merge pull request #167 from timholy/teh/===
Use === in more places to reduce invalidation
2 parents 9499252 + 4983478 commit 7bc92b7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/match/macro.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function clauses(ex)
3939
for l in ex.args
4040
isline(l) && (line = l; continue)
4141
env = trymatch(:(pat_ => yes_), l)
42-
env == nothing && error("Invalid match clause $l")
42+
env === nothing && error("Invalid match clause $l")
4343
pat, yes = env[:pat], env[:yes]
4444
push!(clauses, (pat, :($line;$yes)))
4545
end
@@ -70,7 +70,7 @@ macro capture(ex, pat)
7070
quote
7171
$([:($(esc(b)) = nothing) for b in bs]...)
7272
env = trymatch($(esc(Expr(:quote, pat))), $(esc(ex)))
73-
if env == nothing
73+
if env === nothing
7474
false
7575
else
7676
$([:($(esc(b)) = get(env, $(esc(Expr(:quote, b))), nothing)) for b in bs]...)

src/match/match.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ match(::LineNumberNode, ::LineNumberNode, _) = nothing
9696

9797
function match(pat, ex, env)
9898
pat = normalise(pat)
99-
pat == :_ && return env
99+
pat === :_ && return env
100100
isbinding(pat) && return store!(env, bname(pat), ex)
101101
ex = normalise(ex)
102102
pat, ex = blockunify(pat, ex)

src/match/union.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ or_(p...) = foldl(or_, p)
88

99
function match_inner(pat::OrBind, ex, env)
1010
env′ = trymatch(pat.pat1, ex)
11-
env′ == nothing ? match(pat.pat2, ex, env) : merge!(env, env′)
11+
env′ === nothing ? match(pat.pat2, ex, env) : merge!(env, env′)
1212
end
1313

1414
function isor(ex)

0 commit comments

Comments
 (0)