Skip to content

Commit 5197611

Browse files
jvillardfacebook-github-bot
authored andcommitted
[ondemand] switch to a hash queue
Summary: The time to care about the order in which procedures became active has come. Reviewed By: skcho Differential Revision: D63633470 fbshipit-source-id: 3a837053c18a9b0179fe99083b1aa941fe7c770b
1 parent 0a197fe commit 5197611

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

infer/src/backend/ondemand.ml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,19 @@ module ActiveProcedures : sig
4040
end = struct
4141
type active = SpecializedProcname.t
4242

43-
(* can be switched to a [HashQueue] if we ever need to keep track of the order as well *)
44-
module AnalysisTargets = HashSet.Make (SpecializedProcname)
43+
module AnalysisTargets = Hash_queue.Make (SpecializedProcname)
4544

46-
let currently_analyzed = AnalysisTargets.create 0
45+
let currently_analyzed = AnalysisTargets.create ()
4746

4847
let mem analysis_target = AnalysisTargets.mem currently_analyzed analysis_target
4948

50-
let add analysis_target = AnalysisTargets.add analysis_target currently_analyzed
49+
let add analysis_target = AnalysisTargets.enqueue_back_exn currently_analyzed analysis_target ()
5150

52-
let remove analysis_target = AnalysisTargets.remove analysis_target currently_analyzed
51+
let remove analysis_target = AnalysisTargets.remove_exn currently_analyzed analysis_target
5352

5453
let clear () = AnalysisTargets.clear currently_analyzed
5554

56-
let get_all () = AnalysisTargets.seq currently_analyzed |> Seq.fold_left (Fn.flip List.cons) []
55+
let get_all () = AnalysisTargets.keys currently_analyzed
5756
end
5857

5958
(** an alternative mean of "cutting" recursion cycles used when replaying a previous analysis: times

0 commit comments

Comments
 (0)