This is reported by the Logtalk linter (git version) as:
* Suspicious call: findall(A,find_exp(B,C),D) instead of find_exp(B,C),fail;true
* while compiling object viterbi
* in file /Users/pmoura/Downloads/cplint-master/prolog/viterbi.pl between lines 48-62
As suggested in the warning message, using instead a (find_exp(B,C),fail;true) goal is both clear and faster.
The following goal is costly and a bad programming idiom:
https://github.com/friguzzi/cplint/blob/5fa2d56991729b8d37b6ea9c7c2ca9184462b32f/prolog/viterbi.pl#L56
This is reported by the Logtalk linter (git version) as:
As suggested in the warning message, using instead a
(find_exp(B,C),fail;true)
goal is both clear and faster.