[PATCH 4 of 6 RFC] radixlink: add pure C implementation for radixlink read operation

Augie Fackler raf at durin42.com
Wed May 24 17:30:26 EDT 2017


> On May 24, 2017, at 17:27, Jun Wu <quark at fb.com> wrote:
> 
> Excerpts from Augie Fackler's message of 2017-05-24 17:21:48 -0400:
>> [...]
>> 
>> nit: could these be static inline and let the compiler do the work of
>> making it efficient? I'd kind of rather that than macros...
> 
> They are mainly to make the code shorter and easier to read. Compare:
> 
>  uint8_t x;
>  read8(x, data, offset);
> 
> with:
> 
>  uint8_t x;
>  if (tryreadoffset(...) == -1) {
>    return -1;
>  }
> 
> I guess we prefer the more explicit (longer) way. I can replace macros.

In a perfect world shorter would always be better, but yeah, I'd rather avoid the macros I guess.

> 
>> [...]



More information about the Mercurial-devel mailing list