Re: [PATCH v2 1/3] fetch-pack: return enum from process_acks()
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 30 quoted lines
>> /* return 0 if no common, 1 if there are common, or 2 if ready */
>
> This comment can be removed now, which is a nice bonus.
>
>> - return received_ready ? 2 : (received_ack ? 1 : 0);
>> + return received_ready ? READY :
>> + (received_ack ? COMMON_FOUND : NO_COMMON_FOUND);
>> }
>>
>> static void receive_shallow_info(struct fetch_pack_args *args,
>> @@ -1508,13 +1529,13 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
>> case FETCH_PROCESS_ACKS:
>> /* Process ACKs/NAKs */
>> switch (process_acks(negotiator, &reader, &common)) {
>> - case 2:
>> + case READY:
>> state = FETCH_GET_PACK;
>> break;
>> - case 1:
>> + case COMMON_FOUND:
>> in_vain = 0;
>> /* fallthrough */
>> - default:
>> + case NO_COMMON_FOUND:
>> state = FETCH_SEND_REQUEST;
>> break;
>> }
>
> With the extraneous comment removed,
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>Yes, the result reads very clearly.
Locally amended.
Thanks.