From a40a18fc0181b2b0c59a20dcd89bee7b38d63e40 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sun, 11 Jul 2021 18:53:02 +0000 Subject: Using member and then cut always picks the first element anyways, so just pick it with = instead --- stdlib.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stdlib.pl b/stdlib.pl index c4005cd..7e4822d 100644 --- a/stdlib.pl +++ b/stdlib.pl @@ -264,9 +264,7 @@ bagof(Template, Goal, Instances) :- bagof_loop(Witness, S, Instances). bagof_loop(Witness, S, Instances) :- - S \== [], - member(W+T, S), - !, + [W+T|_] = S, bagof_wt_list(S, W+T, WT_list), bagof_split(WT_list, W_list, T_list), ( bagof_unify_list(Witness, W_list), Instances = T_list -- cgit v1.2.3