Skip to content

Commit

Permalink
in_egal --> contains_is
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed May 2, 2017
1 parent 8ab419f commit ad3534e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2384,22 +2384,22 @@ end
function add_backedge!(frame::InferenceState, caller::InferenceState, currpc::Int)
update_valid_age!(frame, caller)
backedge = (caller, currpc)
in_egal(backedge, frame.backedges) || push!(frame.backedges, backedge)
contains_is(frame.backedges, backedge) || push!(frame.backedges, backedge)
return frame
end

function in_egal(item, collection)
function contains_is(item, collection)
for x in collection
x === item && return true
end
return false
end

function union_caller_cycle!(a::InferenceState, b::InferenceState)
in_egal(b, a.callers_in_cycle) || push!(a.callers_in_cycle, b)
contains_is(a.callers_in_cycle, b) || push!(a.callers_in_cycle, b)
b.callers_in_cycle === a.callers_in_cycle && return
for caller in b.callers_in_cycle
in_egal(caller, a.callers_in_cycle) || push!(a.callers_in_cycle, caller)
contains_is(a.callers_in_cycle, caller) || push!(a.callers_in_cycle, caller)
end
b.callers_in_cycle = a.callers_in_cycle
return nothing
Expand Down

0 comments on commit ad3534e

Please sign in to comment.