summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystemmodel.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2009-08-26 18:52:24 -0500
committerBenjamin Otte <otte@gnome.org>2009-10-15 22:06:13 +0200
commit3232c469fc87b98121817e08947e0b62bacf5720 (patch)
treec98233a2b9dca4b496bcd4f6cc394f5ce2d248a1 /gtk/gtkfilesystemmodel.c
parent51104156845fb9adcd94f6620415775d49ad6f95 (diff)
downloadgtk+-3232c469fc87b98121817e08947e0b62bacf5720.tar.gz
Start with a file array with a resonable preallocated size
g_array_new() doesn't reserve any size by default, so during the initial population of the file array, we'll do more reallocs than strictly needed. We'll start with a reasonable preallocated size, in this case the number of files which we can get in a single chunk out of GIO. Signed-off-by: Federico Mena Quintero <federico@novell.com>
Diffstat (limited to 'gtk/gtkfilesystemmodel.c')
-rw-r--r--gtk/gtkfilesystemmodel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 7cba000b2e..3390ab2e03 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1111,7 +1111,7 @@ gtk_file_system_model_set_n_columns (GtkFileSystemModel *model,
model->sort_list = _gtk_tree_data_list_header_new (n_columns, model->column_types);
- model->files = g_array_new (FALSE, FALSE, model->node_size);
+ model->files = g_array_sized_new (FALSE, FALSE, model->node_size, FILES_PER_QUERY);
/* add editable node at start */
g_array_set_size (model->files, 1);
memset (get_node (model, 0), 0, model->node_size);