From bcab9f794d04477fdbedc82961510c80f8cbab05 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 18 May 2023 22:40:12 +0200 Subject: [PATCH] bitset: Silence gcc warning. * lib/bitset/list.c (lbitset_copy_): Remove redundant test from the loop's first iteration. --- ChangeLog | 6 ++++++ lib/bitset/list.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0216321fc6..1796c625ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-05-18 Bruno Haible + + bitset: Silence gcc warning. + * lib/bitset/list.c (lbitset_copy_): Remove redundant test from the + loop's first iteration. + 2023-05-18 Bruno Haible stack: Silence gcc warning in tests. diff --git a/lib/bitset/list.c b/lib/bitset/list.c index f73ea70fee..eee7fefeeb 100644 --- a/lib/bitset/list.c +++ b/lib/bitset/list.c @@ -441,7 +441,8 @@ lbitset_copy_ (bitset dst, bitset src) lbitset_elt *prev = 0; lbitset_elt *tmp; - for (lbitset_elt *elt = head; elt; elt = elt->next) + lbitset_elt *elt = head; + do { tmp = lbitset_elt_alloc (); tmp->index = elt->index; @@ -454,7 +455,10 @@ lbitset_copy_ (bitset dst, bitset src) prev = tmp; memcpy (tmp->words, elt->words, sizeof (elt->words)); + + elt = elt->next; } + while (elt); LBITSET_TAIL (dst) = tmp; dst->b.csize = LBITSET_ELT_WORDS; -- 2.39.5