Re: [PATCH] difftool: add env vars directly in run_file_diff()

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

 



On Sun, May 26, 2024 at 10:16:50PM +0200, René Scharfe wrote:
> Add the environment variables of the child process directly using
> strvec_push() instead of building an array out of them and then adding
> that using strvec_pushv().  The new code is shorter and avoids magic
> array index values and fragile array padding.
> 
> Signed-off-by: René Scharfe <l.s.r@xxxxxx>

I don't know whether this may cause more allocations. But even if it
did, it would very much feel like a micro-optimization that is not worth
it in the end given that we're about to spawn a new process anyway,
which is way more expensive.

So favoring readability/maintainability very much feels like the right
thing to do here, and the result looks good to me. Thanks!

Patrick

Attachment: signature.asc
Description: PGP signature


[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