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): remove unnecessary code from Hash_Dele...



details:   https://anonhg.NetBSD.org/src/rev/646fb6edb102
branches:  trunk
changeset: 1014823:646fb6edb102
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 03 22:33:26 2020 +0000

description:
make(1): remove unnecessary code from Hash_DeleteEntry

This function is only called 2 times, and both callers pass valid
arguments.

diffstat:

 usr.bin/make/hash.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 657ee8995b2f -r 646fb6edb102 usr.bin/make/hash.c
--- a/usr.bin/make/hash.c       Sat Oct 03 22:32:50 2020 +0000
+++ b/usr.bin/make/hash.c       Sat Oct 03 22:33:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.c,v 1.36 2020/10/03 22:25:04 rillig Exp $ */
+/*     $NetBSD: hash.c,v 1.37 2020/10/03 22:33:26 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -79,7 +79,7 @@
 #include "make.h"
 
 /*     "@(#)hash.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: hash.c,v 1.36 2020/10/03 22:25:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.37 2020/10/03 22:33:26 rillig Exp $");
 
 /*
  * Forward references to local procedures that are used before they're
@@ -257,8 +257,6 @@
 {
        Hash_Entry **hp, *p;
 
-       if (e == NULL)
-               return;
        for (hp = &t->buckets[e->namehash & t->bucketsMask];
             (p = *hp) != NULL; hp = &p->next) {
                if (p == e) {
@@ -268,7 +266,6 @@
                        return;
                }
        }
-       (void)write(2, "bad call to Hash_DeleteEntry\n", 29);
        abort();
 }
 



Home | Main Index | Thread Index | Old Index