Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

>>> -	strbuf_add(dest, src, n);
>>> +	if (0 < n)
>>> +		strbuf_add(dest, src, n);
>>
>> This check seems unnecessary.  strbuf_add can cope fine with !n.
>
> I was primarily interested in catching negatives, and !n was a mere
> optimization, but you are correct to point out that negative n at
> this point in the codeflow is a BUG().

Actually, let's just lose the conditional.  strbuf_add() would catch
and issue an error message when it notices that we fed negative
count anyway ;-).



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

  Powered by Linux