From 9623500d0d5fd952056c823a3215a57f29ca8cd1 Mon Sep 17 00:00:00 2001 From: "Jerome M. BERGER" Date: Tue, 20 Mar 2018 09:34:03 +0100 Subject: [PATCH] Fix stats for `or` and `and` nodes. Fixes #79. --- mpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mpc.c b/mpc.c index c7e8f6c..c7672a3 100644 --- a/mpc.c +++ b/mpc.c @@ -3644,7 +3644,7 @@ static int mpc_nodecount_unretained(mpc_parser_t* p, int force) { if (p->type == MPC_TYPE_COUNT) { return 1 + mpc_nodecount_unretained(p->data.repeat.x, 0); } if (p->type == MPC_TYPE_OR) { - total = 0; + total = 1; for(i = 0; i < p->data.or.n; i++) { total += mpc_nodecount_unretained(p->data.or.xs[i], 0); } @@ -3652,7 +3652,7 @@ static int mpc_nodecount_unretained(mpc_parser_t* p, int force) { } if (p->type == MPC_TYPE_AND) { - total = 0; + total = 1; for(i = 0; i < p->data.and.n; i++) { total += mpc_nodecount_unretained(p->data.and.xs[i], 0); }