Re: [PATCH v3 4/6] trailer: make args have their own struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

>> @@ -29,6 +29,12 @@ struct trailer_item {
>>         struct list_head list;
>>         char *token;
>>         char *value;
>> +};
>> +
>> +struct arg_item {
>> +       struct list_head list;
>> +       char *token;
>> +       char *value;
>>         struct conf_info conf;
>>  };
>
> (Unrelated side note:) When first seeing this diff, I assumed the diff
> heuristic is going wild, because it doesn't add a full struct.
> But on a second closer look, I realize this is the only correct diff,
> because we do not account for moved lines from one struct to the
> other.

It probably is not "the only" correct diff, as you actually could
shift it the other way by one to three lines.  I am not sure which
one among four possible diff is the easiest to grok, though.  Both
the above (picking the highest possible position) and the below (the
other extreme) are probably easier to read than anything in between.

 struct trailer_item {
+	struct list_head list;
+	char *token;
+	char *value;
+};
+
+struct arg_item {
 	struct list_head list;
 	char *token;
 	char *value;
 	struct conf_info conf;
 };
 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]