I agree that running the search twice is probably ok. However, John raises another point which seems relevant. What if there is more than one partial match? Right now it returns the first one. It would seem better to punt if there is no full match and more than one partial match.

          Mike

On 5 Jan 2020, at 15:47, Christian Stimming wrote:

I think two passes is fine. We have a O(n) complexity anyway, and O(2n) is not worse than that. So I think running one pass looking for exact match, then (if
none was found) looking for the partial match, is fine overall.

Caching partial matches in an extra list with element creation and such IMHO introduces a whole lot of extra complexity that isn't really needed. Just
running the search twice should be fine.
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to