aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-table-adapter.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-30 04:36:24 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-30 04:36:24 +0800
commitaa1899af14ef8c2792b5c25b3aef6f5b6a9a92ac (patch)
treef479642f4b221fdf278578624c2dc71e04425a51 /widgets/table/e-tree-table-adapter.c
parentf828accd314674f31de652bf4cd5d0b5e136f9ab (diff)
downloadgsoc2013-evolution-aa1899af14ef8c2792b5c25b3aef6f5b6a9a92ac.tar.gz
gsoc2013-evolution-aa1899af14ef8c2792b5c25b3aef6f5b6a9a92ac.tar.zst
gsoc2013-evolution-aa1899af14ef8c2792b5c25b3aef6f5b6a9a92ac.zip
Don't go outside the table looking for matches when doing the last_access
2001-10-29 Christopher James Lahey <clahey@ximian.com> * e-table-subset.c (etss_get_view_row), e-tree-sorted.c (check_last_access), e-tree-table-adapter.c (find_row_num): Don't go outside the table looking for matches when doing the last_access search. svn path=/trunk/; revision=14359
Diffstat (limited to 'widgets/table/e-tree-table-adapter.c')
-rw-r--r--widgets/table/e-tree-table-adapter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index b18fbb137c..862c540b6c 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -265,13 +265,14 @@ find_row_num(ETreeTableAdapter *etta, ETreePath path)
if (etta->priv->last_access != -1) {
int end = MIN(etta->priv->n_map, etta->priv->last_access + 10);
int start = MAX(0, etta->priv->last_access - 10);
- for (i = etta->priv->last_access; i < end; i++) {
+ int initial = MAX (MIN (etta->priv->last_access, end), start);
+ for (i = initial; i < end; i++) {
if(etta->priv->map_table[i] == path) {
d(g_print("Found last access %d at row %d. (find_row_num)\n", etta->priv->last_access, i));
return i;
}
}
- for (i = etta->priv->last_access - 1; i >= start; i--) {
+ for (i = initial - 1; i >= start; i--) {
if(etta->priv->map_table[i] == path) {
d(g_print("Found last access %d at row %d. (find_row_num)\n", etta->priv->last_access, i));
return i;