[gtk/wip/otte/for-master: 3/11] treepath: Use g_renew()



commit 03e7c7fab18c6be39b6089c0db9ca35ef39fd142
Author: Benjamin Otte <otte redhat com>
Date:   Fri Mar 6 04:31:30 2020 +0100

    treepath: Use g_renew()

 gtk/gtktreemodel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index 226791ab5a..6a34674749 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -802,12 +802,8 @@ gtk_tree_path_append_index (GtkTreePath *path,
 
   if (path->depth == path->alloc)
     {
-      gint *indices;
       path->alloc = MAX (path->alloc * 2, 1);
-      indices = g_new (gint, path->alloc);
-      memcpy (indices, path->indices, path->depth * sizeof (gint));
-      g_free (path->indices);
-      path->indices = indices;
+      path->indices = g_renew (gint, path->indices, path->alloc);
     }
 
   path->depth += 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]