···161161 let compare (t1, _) (t2, _) = Float.compare t1 t2
162162 end)
163163164164- type node_state = {
165165- arrival_time : float;
166166- predecessor : Contact.t option;
167167- }
164164+ type node_state = { arrival_time : float; predecessor : Contact.t option }
168165169166 type state = {
170167 plan : Contact_plan.t;
···192189 Contact_plan.nodes plan
193190 |> List.fold_left
194191 (fun map node ->
195195- let arrival_time = if Node.equal node src then time else Float.infinity in
192192+ let arrival_time =
193193+ if Node.equal node src then time else Float.infinity
194194+ in
196195 H.add heap (arrival_time, node);
197196 Node_map.add node { arrival_time; predecessor = None } map)
198197 Node_map.empty
···200199 let nodes = ref nodes in
201200 (* Main loop with lazy deletion *)
202201 while not (H.is_empty heap) do
203203- let (current_time, current) = H.pop_minimum heap in
204204- let current_state = get_node_state { plan; src; start_time = time; nodes = !nodes } current in
202202+ let current_time, current = H.pop_minimum heap in
203203+ let current_state =
204204+ get_node_state { plan; src; start_time = time; nodes = !nodes } current
205205+ in
205206 (* Lazy deletion: skip if this entry is stale *)
206206- if Float.equal current_time current_state.arrival_time && Float.is_finite current_time then begin
207207+ if
208208+ Float.equal current_time current_state.arrival_time
209209+ && Float.is_finite current_time
210210+ then begin
207211 (* Relax edges *)
208212 List.iter
209213 (fun contact ->
210214 let neighbor = Contact.to_ contact in
211215 let neighbor_state =
212212- get_node_state { plan; src; start_time = time; nodes = !nodes } neighbor
216216+ get_node_state
217217+ { plan; src; start_time = time; nodes = !nodes }
218218+ neighbor
213219 in
214220 (* Can we use this contact? *)
215221 if current_time < Contact.stop contact then begin
···229235 done;
230236 { plan; src; start_time = time; nodes = !nodes }
231237232232- let init plan ~src ~time =
233233- run plan ~src ~time
238238+ let init plan ~src ~time = run plan ~src ~time
234239235240 let extract_route state ~dst =
236241 let ns = get_node_state state dst in
···244249 | Some contact -> build_path (Contact.from contact) (contact :: acc)
245250 in
246251 let path = build_path dst [] in
247247- Some { Route.hops = path; src = state.src; dst; start_time = state.start_time }
252252+ Some
253253+ {
254254+ Route.hops = path;
255255+ src = state.src;
256256+ dst;
257257+ start_time = state.start_time;
258258+ }
248259249260 (* For API compatibility *)
250261 let step state = Some state
···270281 (* Remove the first contact to find alternative routes *)
271282 let plan' =
272283 Contact_plan.of_list
273273- (List.filter (fun c -> c != first_hop) (Contact_plan.contacts plan))
284284+ (List.filter
285285+ (fun c -> c != first_hop)
286286+ (Contact_plan.contacts plan))
274287 in
275288 loop plan' (count + 1) (route :: acc))
276289 in