mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-tree-model-split-reg.c] don't call g_list_length
use model->number_of_trans_in_full_tlist instead which has already stored the length.
This commit is contained in:
@@ -638,7 +638,7 @@ gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Accoun
|
||||
|
||||
model->number_of_trans_in_full_tlist = g_list_length (priv->full_tlist);
|
||||
|
||||
if (g_list_length (priv->full_tlist) < NUM_OF_TRANS*3)
|
||||
if (model->number_of_trans_in_full_tlist < NUM_OF_TRANS*3)
|
||||
{
|
||||
// Copy the full_tlist to tlist
|
||||
priv->tlist = g_list_copy (priv->full_tlist);
|
||||
@@ -647,8 +647,11 @@ gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Accoun
|
||||
{
|
||||
if (model->position_of_trans_in_full_tlist < (NUM_OF_TRANS*3))
|
||||
gtm_sr_reg_load (model, VIEW_HOME, NUM_OF_TRANS*3);
|
||||
else if (model->position_of_trans_in_full_tlist > g_list_length (priv->full_tlist) - (NUM_OF_TRANS*3))
|
||||
|
||||
else if (model->position_of_trans_in_full_tlist >
|
||||
model->number_of_trans_in_full_tlist - (NUM_OF_TRANS*3))
|
||||
gtm_sr_reg_load (model, VIEW_END, NUM_OF_TRANS*3);
|
||||
|
||||
else
|
||||
gtm_sr_reg_load (model, VIEW_GOTO, model->position_of_trans_in_full_tlist);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user