[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] bitset: fix iteration over table bitsets
From: |
Akim Demaille |
Subject: |
[PATCH 6/6] bitset: fix iteration over table bitsets |
Date: |
Tue, 17 Nov 2020 18:59:29 +0100 |
* lib/bitset/table.c (tbitset_list): Update bitno when windex is.
---
ChangeLog | 5 +++++
lib/bitset/table.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f3df478d1..1aa7317a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-17 Akim Demaille <akim@lrde.epita.fr>
+
+ bitset: fix iteration over table bitsets
+ * lib/bitset/table.c (tbitset_list): Update bitno when windex is.
+
2020-11-17 Akim Demaille <akim@lrde.epita.fr>
bitset: rename internal details for consistency
diff --git a/lib/bitset/table.c b/lib/bitset/table.c
index b762f5951..d111e0203 100644
--- a/lib/bitset/table.c
+++ b/lib/bitset/table.c
@@ -649,15 +649,16 @@ tbitset_list (bitset bset, bitset_bindex *list,
for (; eindex < size; eindex++)
{
- bitset_word *srcp;
tbitset_elt *elt = elts[eindex];
if (!elt)
continue;
- srcp = TBITSET_WORDS (elt);
+ bitset_word *srcp = TBITSET_WORDS (elt);
bitset_windex windex = eindex * TBITSET_ELT_WORDS;
+ bitno = windex * BITSET_WORD_BITS;
+ /* Is there enough room to avoid checking in each iteration? */
if ((count + TBITSET_ELT_BITS) < num)
{
/* The coast is clear, plant boot! */
--
2.29.2
- [PATCH 0/6] bitset: clean up, test, fix, accelerate, Akim Demaille, 2020/11/17
- [PATCH 1/6] bitset: use ffs where possible in array implementation, Akim Demaille, 2020/11/17
- [PATCH 2/6] bitset: use ffs where possible in the list implementation, Akim Demaille, 2020/11/17
- [PATCH 3/6] bitset: test: run deterministic tests on several bitset sizes, Akim Demaille, 2020/11/17
- [PATCH 4/6] bitset: strengthen tests, Akim Demaille, 2020/11/17
- [PATCH 5/6] bitset: rename internal details for consistency, Akim Demaille, 2020/11/17
- [PATCH 6/6] bitset: fix iteration over table bitsets,
Akim Demaille <=
- Re: [PATCH 0/6] bitset: clean up, test, fix, accelerate, Bruno Haible, 2020/11/17