[glib: 8/12] dataset: Improve readability
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 8/12] dataset: Improve readability
- Date: Thu, 7 Jul 2022 11:52:20 +0000 (UTC)
commit 8bd63258a538ea59782cdb2e14614f1cfb3b3a37
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon Jun 27 17:42:11 2022 -0400
dataset: Improve readability
Improve the readability by using a temporary variable
glib/gdataset.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/glib/gdataset.c b/glib/gdataset.c
index 2ac78b9d55..88306c3895 100644
--- a/glib/gdataset.c
+++ b/glib/gdataset.c
@@ -526,11 +526,14 @@ g_data_remove_internal (GData **datalist,
if (remove)
{
+ GDataElt *data_last = data_end - 1;
+
found_keys++;
- if (data < --data_end)
- *data = *data_end;
+ if (data < data_last)
+ *data = *data_last;
+ data_end--;
d->len--;
/* We don't bother to shrink, but if all data are now gone
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]