Re: [PATCH v2 1/3] diffcore-pickaxe: remove unnecessary call to get_textconv()
- From
Simon Ruderich <simon@ruderich.org>
- Date
- Apr 5, 2013, 13:20 UTC
- Message-ID
- <20130405132033.GB23017@ruderich.org>
- In-Reply-To
- <7vvc82ggy3.fsf@alter.siamese.dyndns.org>
On Thu, Apr 04, 2013 at 01:48:52PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> If I am reading the code correctly, it is has_changes(), which is > used for "log -S" (not "log -G" that uses diff_grep()), that does > the unnecessary get_textconv() unconditionally. The way diff_grep() > divides the work to make fill_one() responsible for filling the > textconv as necessary is internally consistent, and there is no > unnecessary call.
Yes, of course. I meant has_changes() which has the unnecessary call.
Show 15 quoted lines
> Perhaps... > > The fill_one() function is responsible for finding and > filling the textconv filter as necessary, and is called by > diff_grep() function that implements "git log -G<pattern>". > > The has_changes() function calls get_textconv() for two > sides being compared, before it checks to see if it was > asked to perform the pickaxe limiting with the -S option. > Move the code around to avoid this wastage. After that, > fill_one() is called to use the textconv. > > By adding get_textconv() to diff_grep() and relieving > fill_one() of responsibility to find the textconv filter, we > can avoid calling get_textconv() twice.
Sounds good to me.
Regards Simon
-- + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9