Re: [PATCH] name-rev: rewrite create_or_update_name()
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Dec 9, 2019, 12:43 UTC
- Message-ID
- <20191209124351.GD2746@szeder.dev>
- In-Reply-To
- <20190922081846.14452-1-martin.agren@gmail.com>
On Sun, Sep 22, 2019 at 10:18:46AM +0200, Martin Ågren wrote:
> This code was moved straight out of name_rev(). As such, we inherited > the "goto" to jump from an if into an else-if. We also inherited the > fact that "nothing to do -- return NULL" is handled last.
> For the record, --color-moved confirms that your patch is a move and > the conversion around it looks good to me. I was a bit puzzled by what > the moved code actually wanted to *do* and came up with this rewrite.
Yeah, I had a bit of a "Huh?!" moment myself looking at that goto jumping over the condition, too... Initially I left it as-is to keep this patch a pure code movement, and that others might have a bit of fun as well when they stumble upon it in the future ;)
> It seems there was some discussion around leaks and leak-plugs. That > would conflict/interact with this.
And I didn't pick it up in later versions, because René's plans to clean up memory ownership would deal with it (and with much more) as well.