Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): save a strlen call in ForIterate



details:   https://anonhg.NetBSD.org/src/rev/99d7c1dc8a66
branches:  trunk
changeset: 954625:99d7c1dc8a66
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 07 06:28:22 2020 +0000

description:
make(1): save a strlen call in ForIterate

diffstat:

 usr.bin/make/for.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r ee4fc47ab3c9 -r 99d7c1dc8a66 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Mon Sep 07 06:27:29 2020 +0000
+++ b/usr.bin/make/for.c        Mon Sep 07 06:28:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.77 2020/09/07 06:27:29 rillig Exp $  */
+/*     $NetBSD: for.c,v 1.78 2020/09/07 06:28:22 rillig Exp $  */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.77 2020/09/07 06:27:29 rillig Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.78 2020/09/07 06:28:22 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.77 2020/09/07 06:27:29 rillig Exp $");
+__RCSID("$NetBSD: for.c,v 1.78 2020/09/07 06:28:22 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -445,6 +445,7 @@
     }
     Buf_AddBytesBetween(&cmds, cmd_cp, body_end);
 
+    *ret_len = Buf_Size(&cmds);
     cmds_str = Buf_Destroy(&cmds, FALSE);
     if (DEBUG(FOR))
        (void)fprintf(debug_file, "For: loop body:\n%s", cmds_str);
@@ -452,7 +453,6 @@
     arg->sub_next += strlist_num(&arg->vars);
 
     arg->parse_buf = cmds_str;
-    *ret_len = strlen(cmds_str);
     return cmds_str;
 }
 



Home | Main Index | Thread Index | Old Index