diff options
Diffstat (limited to 'lib/dialyzer/src/dialyzer_coordinator.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_coordinator.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/dialyzer/src/dialyzer_coordinator.erl b/lib/dialyzer/src/dialyzer_coordinator.erl index 437af69f5a..9d31c739d0 100644 --- a/lib/dialyzer/src/dialyzer_coordinator.erl +++ b/lib/dialyzer/src/dialyzer_coordinator.erl @@ -123,8 +123,8 @@ sccs_to_pids_request(SCCs, Coordinator) -> cast({sccs_to_pids, SCCs, self()}, Coordinator). scc_to_pids_request_handle(Worker, SCCs, SCCtoPID) -> - Pids = [fetch_map(SCC, SCCtoPID) || SCC <- SCCs], - Worker ! {sccs_to_pids, Pids}, + Result = map_lookup(SCCs, SCCtoPID), + Worker ! {sccs_to_pids, Result}, ok. -spec sccs_to_pids_reply() -> [dialyzer_worker:worker()]. @@ -314,5 +314,12 @@ new_map() -> store_map(Key, Value, Map) -> dict:store(Key, Value, Map). -fetch_map(Key, Map) -> - dict:fetch(Key, Map). +map_lookup(SCCs, Map) -> + Fold = + fun(Key, {Mapped, Unknown}) -> + case dict:find(Key, Map) of + {ok, Value} -> {[Value|Mapped], Unknown}; + error -> {Mapped, [Key|Unknown]} + end + end, + lists:foldl(Fold, {[], []}, SCCs). |