+2001-11-28 Akim Demaille <akim@epita.fr>
+
+ * src/closure.c (closure): Instead of looping over word in array
+ then bits in words, loop over bits in array.
+
+
2001-11-28 Akim Demaille <akim@epita.fr>
* src/closure.c (closure): No longer optimize the special case
/* Index over RULESET. */
int r;
- int itemno;
+ /* A bit index over RULESET. */
+ int b;
if (trace_flag)
{
ruleno = 0;
itemsetsize = 0;
c = 0;
- for (r = 0; r < rulesetsize; ++r)
+ for (b = 0; b < rulesetsize * BITS_PER_WORD; ++b)
{
- int b;
-
- for (b = 0; b < BITS_PER_WORD; b++)
+ if (BITISSET (ruleset, b))
{
- if (ruleset[r] & (1 << b))
+ int itemno = rule_table[ruleno].rhs;
+ while (c < n && core[c] < itemno)
{
- itemno = rule_table[ruleno].rhs;
- while (c < n && core[c] < itemno)
- {
- itemset[itemsetsize] = core[c];
- itemsetsize++;
- c++;
- }
- itemset[itemsetsize] = itemno;
+ itemset[itemsetsize] = core[c];
itemsetsize++;
+ c++;
}
-
- ruleno++;
+ itemset[itemsetsize] = itemno;
+ itemsetsize++;
}
+
+ ruleno++;
}
while (c < n)