aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-10-27 10:31:08 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-10-27 10:31:08 +0800
commitb234a3141bf6607ac8f4a980637d5f63e9b74511 (patch)
tree24c9ed7d970b4f77e786109ef6cad5165b1ef65f
parent8a112f4e6206e0a7a55086a0e311231458535add (diff)
downloadgsoc2013-evolution-b234a3141bf6607ac8f4a980637d5f63e9b74511.tar.gz
gsoc2013-evolution-b234a3141bf6607ac8f4a980637d5f63e9b74511.tar.zst
gsoc2013-evolution-b234a3141bf6607ac8f4a980637d5f63e9b74511.zip
If we are inserting into the root level, we dont have to search the whole
2000-10-27 Not Zed <NotZed@HelixCode.com> * e-tree-model.c (e_tree_model_node_insert): If we are inserting into the root level, we dont have to search the whole array for a parent node we'll never find. svn path=/trunk/; revision=6218
-rw-r--r--widgets/table/e-tree-model.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 918c286b34..2b5f3fa6b0 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -909,7 +909,12 @@ e_tree_model_node_insert (ETreeModel *tree_model,
if (position == -1)
position = e_tree_model_node_num_visible_descendents (tree_model, parent_path) - 1;
- parent_row = e_tree_model_row_of_node (tree_model, parent_path);
+ /* if the parent is the root, no need to search for its position since it aint there */
+ if (parent_path->parent == NULL) {
+ parent_row = -1;
+ } else {
+ parent_row = e_tree_model_row_of_node (tree_model, parent_path);
+ }
priv->row_array = g_array_insert_val (priv->row_array,
parent_row + position + 1, new_path);