From: Stefan Sperling Subject: Re: got: parse.y: Remove superfluous strdup(3) calls To: Tracey Emery , Martin Vahlensieck , gameoftrees@openbsd.org Date: Tue, 31 Aug 2021 21:12:00 +0200 On Tue, Aug 31, 2021 at 09:29:05AM +0200, Stefan Sperling wrote: > On Mon, Aug 30, 2021 at 03:32:39PM -0600, Tracey Emery wrote: > > On Mon, Aug 30, 2021 at 10:00:41PM +0200, Martin Vahlensieck wrote: > > > Hi > > > > > > In the grammar (for gotweb and got-read-gotconfig) $2 points to a > > > freshly allocated string. This string is then duplicated and the > > > original ($2) is freed. Simplify this by assigning $2 directly. Also > > > something similar happens in yyerror, so this is changed as well. > > > > > > Or am I overlooking something? > > > > > > Best, > > > > > > Martin > > > > > > > I don't think the diff is wrong. I've just often waffled over the two > > implementations. I'm fine with this change. Anyone else care to comment? > > I'm in favour of this change. > Fewer lines of code getting the same job done. What's not to like? Committed. Thank you Martin!