diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-11 18:53:02 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-11 18:53:02 +0000 |
commit | a40a18fc0181b2b0c59a20dcd89bee7b38d63e40 (patch) | |
tree | 57ac2d96e936ca3d3cb59ba3573b6af05cecf89d /stdlib.pl | |
parent | 81fa4d4a176b5e330ffe20b2ed9f92b10ffc5ba9 (diff) |
Using member and then cut always picks the first element anyways, so just pick it with = instead
Diffstat (limited to 'stdlib.pl')
-rw-r--r-- | stdlib.pl | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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 |