Re: [PATCH v3 10/15] ref-filter: introduce parse_align_position()
On Tue, Jan 26, 2016 at 3:19 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 28 quoted lines
> On Tue, Jan 5, 2016 at 3:03 AM, Karthik Nayak <karthik.188@gmail.com> wrote:
>> From align_atom_parser() form parse_align_position() which given a
>> string would give us the alignment position. This is a preparatory
>> patch as to introduce prefixes for the %(align) atom and avoid
>> redundancy in the code.
>>
>> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
>> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
>> ---
>> diff --git a/ref-filter.c b/ref-filter.c
>> @@ -74,6 +74,17 @@ static void color_atom_parser(struct used_atom *atom)
>> +static align_type parse_align_position(const char *s)
>> +{
>> + if (!strcmp(s, "right"))
>> + return ALIGN_RIGHT;
>> + else if (!strcmp(s, "middle"))
>> + return ALIGN_MIDDLE;
>> + else if (!strcmp(s, "left"))
>> + return ALIGN_LEFT;
>> + return -1;
>> +}
>
> This code was just moved in patch 9/15 and is being relocated again
> here in patch 10/15. If you change the order of the patches so that
> this preparatory refactoring is done first, the diff of the "introduce
> align_atom_parser()" patch will become smaller and be a bit easier to
> review. (Plus it just makes sense to do preparation first.)
>It does reduce the diff as you said, I have swapped the order as you suggested.
--
Regards,
Karthik Nayak