Module Name:    src
Committed By:   rillig
Date:           Mon Dec 13 06:11:34 UTC 2021

Modified Files:
        src/usr.bin/make: parse.c

Log Message:
make: clean up loading of files

The call to Buf_DoneData was useless since ownership of the buffer data
has already been passwed on to loadedfile_create and the local variable
'buf' goes out of scope after that statement.

Except for cleaning up in debug mode, there is no reason to call
Buf_DoneData and then discard the returned value.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.576 -r1.577 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.576 src/usr.bin/make/parse.c:1.577
--- src/usr.bin/make/parse.c:1.576	Mon Dec 13 05:25:04 2021
+++ src/usr.bin/make/parse.c	Mon Dec 13 06:11:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.576 2021/12/13 05:25:04 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.577 2021/12/13 06:11:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.576 2021/12/13 05:25:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.577 2021/12/13 06:11:34 rillig Exp $");
 
 /* types and constants */
 
@@ -453,11 +453,7 @@ loadfile(const char *path, int fd)
 	if (path != NULL)
 		close(fd);
 
-	{
-		struct loadedfile *lf = loadedfile_create(buf.data, buf.len);
-		Buf_DoneData(&buf);
-		return lf;
-	}
+	return loadedfile_create(buf.data, buf.len);
 }
 
 static void

Reply via email to