Re: [PATCH 2/5] Don't return 'undef' in case called in a vector context.
- From
Jeff King <peff@peff.net>
- Date
- Nov 22, 2007, 12:06 UTC
- Message-ID
- <20071122120619.GE12913@sigill.intra.peff.net>
- In-Reply-To
- <20071122045534.435f01bb@paradox.zwell.net>
On Thu, Nov 22, 2007 at 04:55:34AM -0600, Dan Zwell wrote:
> Previously, the Git->repository()->config('non-existent.key')
> evaluated to as true in a vector context. Call 'return' with
> no argument, instead.I think the reason this works is a subtle issue (well, I had to look it up, anyway): return without an argument automatically checks the calling context and returns the empty list in a list context. So we are returning an empty list now, instead of a list containing a single undef. I think it might be useful to explain this a bit better in the commit message.
-Peff