Re: [PATCH] pretend_sha1_file(): Change return type from int to void
- From
Tobias Klauser <tklauser@distanz.ch>
- Date
- Oct 6, 2015, 13:51 UTC
- Message-ID
- <20151006135101.GA11304@distanz.ch>
- In-Reply-To
- <632cbcf1dc9fa45ce71693a2cfae73e4@dscho.org>
Hi Johannes
Thanks for your feedback.
On 2015-10-06 at 15:16:12 +0200, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
Show 10 quoted lines
> Hi Tobias, > > On 2015-10-06 14:15, Tobias Klauser wrote: > > prented_sha1_file() always returns 0 and its only callsite in > > builtin/blame.c doesn't use the return value, so change the return type > > to void. > > While this commit message is technically correct, it would appear that there are some things left unsaid. > > Is there a problem with the current code that is solved by not returning 0? If so, could you add it to the commit message? And in particular, change the oneline appropriately?
There's no problem with the current code other than that the return value is unused and thus unnecessary for correct funcionality. So it's certainly not a functional problem but rather a cosmetic change.
Does such a change even make sense (it's one of my first patch to git, so I'm not really sure what your criteria in this respect are)?
If yes, would something like the following bring across the intention more clearly?
pretend_sha1_file() always returns 0 and its only user in builtin/blame.c doesn't use the returned value. Thus, the return value is unnecessary and the return type of pretend_sha1_file() can be changed to void.
Cheers Tobias