diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-05-30 13:12:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-05-30 13:12:40 +0000 |
commit | 7ababbabcf023189f1d801347b84ba77443f7ae3 (patch) | |
tree | 7186df489f026d3a4892942363eab7314265cdd9 /usr.bin/yacc | |
parent | 6ba47ab77800e8e6b1c136de1a196c496a05699e (diff) |
Replace a loop with a memset, from Michael W Bombardieri. White here
also remove an unnecessary assignment pointed out by millert@.
ok millert
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r-- | usr.bin/yacc/closure.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/yacc/closure.c b/usr.bin/yacc/closure.c index 723746e8f6e..9e9782a6b0a 100644 --- a/usr.bin/yacc/closure.c +++ b/usr.bin/yacc/closure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: closure.c,v 1.9 2009/10/27 23:59:50 deraadt Exp $ */ +/* $OpenBSD: closure.c,v 1.10 2012/05/30 13:12:39 nicm Exp $ */ /* $NetBSD: closure.c,v 1.4 1996/03/19 03:21:29 jtc Exp $ */ /* @@ -153,10 +153,8 @@ closure(short *nucleus, int n) int itemno; rulesetsize = WORDSIZE(nrules); - rsp = ruleset; rsend = ruleset + rulesetsize; - for (rsp = ruleset; rsp < rsend; rsp++) - *rsp = 0; + memset(ruleset, 0, rulesetsize * sizeof(*ruleset)); csend = nucleus + n; for (csp = nucleus; csp < csend; ++csp) |