Re: [PATCH v2 09/10] mktree: stop setting *ntr++ to NIL

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> Since 58ce21b819e (builtin/mktree: remove hard-coded constant,
> 2018-10-15) we have not made any subsequent use of the ntr variable
> itself, but we did rely on it to NIL-delimit the string we were about
> to feed to type_from_string().
>
> Using type_from_string() here results in needless work, as we'd do a
> strlen() on it, just to find point at which we had a SPC
> character (now NIL) earlier in this function.

Since when do we write in LISP? ;-)  The name of the ASCII character
with value 0 is NUL (null).

> We can instead skip incrementing the ntr pointer, then pass the
> pointer and length to the type_from_string() function instead.

Makes sense.  Not clobbering the input buffer is good.




[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