- let l1,l2 = List.partition test (smart_local_cands@smart_global_cands) in
- let l1 = if is_eq then [] else l1 in
- let l2 = if by then given_candidates else l2
- in
- l1,l2
+ let sgl1,sgl2 = List.partition test smart_global_cands in
+ let sll1,sll2 = List.partition test smart_local_cands in
+ let l1 = if is_eq then [] else sgl1@sll1 in
+ let l2 =
+ if by && smart then given_candidates@sll2
+ else if by then sll2
+ else sgl2@sll2
+ in l1,l2