Re: [PATCH] string_list: use string-list API in unsorted_string_list_lookup()

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

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

>>  
>> -	for (i = 0; i < list->nr; i++)
>> -		if (!cmp(string, list->items[i].string))
>> -			return list->items + i;
>> +	for_each_string_list_item(item, list) {
>> +		if (!cmp(string, item->string))
>> +			return item;
>> +	}
>>  	return NULL;
>
> If you drop the extra curly braces (thereby matching Git's coding style as
> an additional bonus), at least the patch won't increase the number of
> lines.
>

Oops. I'll send a new version of the patch without these
extra curly braces.

Thanks!

> In any case, I like the simplification of the code.
>
> Ciao,
> Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]