Re: [PATCH v2 [rebased]] [Enhancement] Improve internals / refactoring.
- Date: Fri, 1 Feb 2019 23:09:29 -0400
- From: Brandon Richardson <brandon1024.br@xxxxxxxxx>
- Subject: Re: [PATCH v2 [rebased]] [Enhancement] Improve internals / refactoring.
On Fri, 1 Feb 2019 at 19:54, Shahzad Lone <shahzadlone@xxxxxxxxx> wrote:
> git_zstream stream;
> - unsigned char ibuf[1024 * 16];
> - unsigned char obuf[1024 * 16];
> + unsigned char ibuf;
> + unsigned char obuf;
> unsigned long olen = 0;
This change also brings very little value because most compilers will
evaluate constant expressions such as this at compile time. A quick
google query on "Constant Folding" will tell you all about this.
I love optimization as much as the next guy, but I also feel an argument can
be made for readability too. The former version is far easier to see that
the array will be 16KB in size, where 16384 is more difficult to visualize.