Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 24, 2015, 21:54 UTC
- Message-ID
- <xmqqwpxpjk6p.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1437764685-8633-2-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 9 quoted lines
> - if (!ref->value) {
> - populate_value(ref);
> + /*
> + * If the atom is a pseudo_atom then we re-populate the value
> + * into the ref_formatting_state stucture.
> + */
> + if (!ref->value || ref->value[atom].pseudo_atom) {
> + populate_value(state, ref);
> fill_missing_values(ref->value);I am not sure why you need to do this. populate_value() and fill_missing_values() are fairly heavy-weight operations that are expected to grab everything necessary from scratch, and that is why we ensure that we do not call them more than once for each "ref" with by guarding the calls with "if (!ref->value)".
This change is breaking that basic arrangement, and worse yet, it forces us re-read everything about that ref, leaking old ref->value.
Why could this be a good idea?