Re: [PATCH 1/2] inline constant return from error() function
- From
Jeff King <peff@peff.net>
- Date
- May 12, 2014, 18:13 UTC
- Message-ID
- <20140512181326.GA31164@sigill.intra.peff.net>
- In-Reply-To
- <xmqqppjkut6s.fsf@gitster.dls.corp.google.com>
On Sun, May 11, 2014 at 10:22:03AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> The alternative you mentioned up-thread "... to write out "return > error(...)" as "error(...); return -1". In some ways that is more > readable, though it is more verbose..." has one more downside you > did not mention, and the approach to encapsulate it inside error() > will not have it: new call-sites to error() do not have to worry > about the issue with this approach. > > Until it breaks, that is. But that goes without saying with the > "it's something we can count on" pre-condition in place ;-).
Yeah, I agree with this thinking. I'd rather not do something that impacts each callsite until we have exhausted other options that hide the complexity in the definition.
-Peff