[balsa] mailbox-local: Use g_ptr_array_set_size()
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] mailbox-local: Use g_ptr_array_set_size()
- Date: Wed, 5 Feb 2020 22:26:46 +0000 (UTC)
commit 7ba0b34b53bd39b490b1262f4bd96819dcf18963
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Feb 5 17:25:19 2020 -0500
mailbox-local: Use g_ptr_array_set_size()
instead of adding NULL pointers in a loop.
libbalsa/mailbox_local.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libbalsa/mailbox_local.c b/libbalsa/mailbox_local.c
index 8f3290772..fb077ad2b 100644
--- a/libbalsa/mailbox_local.c
+++ b/libbalsa/mailbox_local.c
@@ -1016,8 +1016,8 @@ lbm_local_cache_message(LibBalsaMailboxLocal * local,
if (!priv->threading_info)
return;
- while (priv->threading_info->len < msgno)
- g_ptr_array_add(priv->threading_info, NULL);
+ if (priv->threading_info->len < msgno)
+ g_ptr_array_set_size(priv->threading_info, msgno);
entry = &g_ptr_array_index(priv->threading_info, msgno - 1);
if (*entry)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]