mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
Use bitset operations when possible, not loops over bits.
* src/conflicts.c (set_conflicts, count_sr_conflicts): Use bitset_or. * src/print.c (print_reductions): Use bitset_and, bitset_andn. * src/reduce.c (useless_nonterminals): Formatting changes. * src/warshall.c (TC): Use bitset_or.
This commit is contained in:
16
src/reduce.c
16
src/reduce.c
@@ -126,16 +126,12 @@ useless_nonterminals (void)
|
||||
{
|
||||
bitset_copy (Np, N);
|
||||
for (i = 1; i <= nrules; i++)
|
||||
{
|
||||
if (!bitset_test (P, i))
|
||||
{
|
||||
if (useful_production (i, N))
|
||||
{
|
||||
bitset_set (Np, rules[i].lhs - ntokens);
|
||||
bitset_set (P, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!bitset_test (P, i)
|
||||
&& useful_production (i, N))
|
||||
{
|
||||
bitset_set (Np, rules[i].lhs - ntokens);
|
||||
bitset_set (P, i);
|
||||
}
|
||||
if (bitset_equal_p (N, Np))
|
||||
break;
|
||||
Ns = Np;
|
||||
|
||||
Reference in New Issue
Block a user