On Mon, May 30, 2005 at 04:31:52AM +0200, Buzz wrote: > * I really tried to get this patch as small as possible. > * The case-folding /can/ be done less often.
Yes. The old code used to do the case-folding on only the new characters read out of the database (that is, each filename character read from the database would be case-folded at most once). However, when I refactored the code to use the Visitor pattern, I sacrificed that optimisation. If you can actually measure the performance impact of the current slightly stupid implementation of visit_substring_match_casefold(), I'll certainly consider applying an optimisation patch. > * These changes prepare a path towards a ``--and'' (``-a'') option. Are you envisaging this option as a single-use option (indicating that all patterns must match) or as a conjunction as used in "find"? For example are you suggesting... locate foo -a bar -o baz I suppose you can already achieve something similar with ( locate 'foo.*bar' 'bar.*foo' ; locate baz ) | sort -u What does the rest of the list think about "-a"? > * It is possible to allow reading a db from stdin. > * Much of the ``main'' loop can be moved into ``visitor''s. If you're talking about refactoring locate(), then yes, it is a bit too long. I'm not sure the current "Visitor" pattern is appropriate for this though. > (If/when this one gets applied, I intend to submit follow-up patches.) Thanks, James. _______________________________________________ Bug-findutils mailing list Bug-findutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-findutils