Source-Changes-HG archive

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

[src/trunk]: src/bin/sh minor optimization in evalvar()



details:   https://anonhg.NetBSD.org/src/rev/0cabf29a540c
branches:  trunk
changeset: 556587:0cabf29a540c
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Dec 21 08:32:39 2003 +0000

description:
minor optimization in evalvar()
change sent in bin/23813 by VaX#n8

diffstat:

 bin/sh/expand.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 3c482aa5ed72 -r 0cabf29a540c bin/sh/expand.c
--- a/bin/sh/expand.c   Sun Dec 21 07:59:25 2003 +0000
+++ b/bin/sh/expand.c   Sun Dec 21 08:32:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.59 2003/09/22 12:17:24 dsl Exp $  */
+/*     $NetBSD: expand.c,v 1.60 2003/12/21 08:32:39 jdolecek Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c   8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.59 2003/09/22 12:17:24 dsl Exp $");
+__RCSID("$NetBSD: expand.c,v 1.60 2003/12/21 08:32:39 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -611,9 +611,7 @@
        varflags = (unsigned char)*p++;
        subtype = varflags & VSTYPE;
        var = p;
-       special = 0;
-       if (! is_name(*p))
-               special = 1;
+       special = !is_name(*p);
        p = strchr(p, '=') + 1;
 again: /* jump here after setting a variable with ${var=text} */
        if (special) {



Home | Main Index | Thread Index | Old Index