Skip to content

Commit 34bdb57

Browse files
committed
Optimize with List.compare_lengths
Signed-off-by: Ming Lu <[email protected]>
1 parent ea89a26 commit 34bdb57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocaml/xapi/xapi_ha_vm_failover.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ let restart_auto_run_vms ~__context ~last_live_set ~live_set n =
16151615
let best_effort_vms =
16161616
(* Carefully decide which best-effort VMs should attempt to start. *)
16171617
let all_prot_is_ok = List.for_all (fun (_, r) -> r = Ok ()) started in
1618-
let is_better = List.length live_set > List.length last_live_set in
1618+
let is_better = List.compare_lengths live_set last_live_set > 0 in
16191619
( match (all_prot_is_ok, is_better, last_live_set = live_set) with
16201620
| true, true, _ ->
16211621
(* Try to start all the best-effort halted VMs when HA is being

0 commit comments

Comments
 (0)