Changeset 12356 for trunk/gtk/details.c


Ignore:
Timestamp:
Apr 13, 2011, 10:00:55 PM (11 years ago)
Author:
jordan
Message:

(trunk gtk) more heap pruning: minor GtkTreeModel? changes

Use gtk_tree_model_iter_nth_child() instead of gtk_tree_model_get_iter_first() to avoid an unnecessary gtk_tree_path object being created and destroyed. This is a very minor change and I'm not sure how useful it really is, but it doesn't hurt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r12353 r12356  
    12711271    /* step 2: mark all the peers in the list as not-updated */
    12721272    model = GTK_TREE_MODEL( store );
    1273     if( gtk_tree_model_get_iter_first( model, &iter ) ) do
     1273    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) do
    12741274        gtk_list_store_set( store, &iter, PEER_COL_WAS_UPDATED, FALSE, -1 );
    12751275    while( gtk_tree_model_iter_next( model, &iter ) );
     
    13151315    /* step 5: remove peers that have disappeared */
    13161316    model = GTK_TREE_MODEL( store );
    1317     if( gtk_tree_model_get_iter_first( model, &iter ) ) {
     1317    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) {
    13181318        gboolean more = TRUE;
    13191319        while( more ) {
     
    13501350
    13511351    /* step 1: mark all webseeds as not-updated */
    1352     if( gtk_tree_model_get_iter_first( model, &iter ) ) do
     1352    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) do
    13531353        gtk_list_store_set( store, &iter, WEBSEED_COL_WAS_UPDATED, FALSE, -1 );
    13541354    while( gtk_tree_model_iter_next( model, &iter ) );
     
    14091409
    14101410    /* step 4: remove webseeds that have disappeared */
    1411     if( gtk_tree_model_get_iter_first( model, &iter ) ) {
     1411    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) {
    14121412        gboolean more = TRUE;
    14131413        while( more ) {
     
    19841984    /* step 2: mark all the trackers in the list as not-updated */
    19851985    model = GTK_TREE_MODEL( store );
    1986     if( gtk_tree_model_get_iter_first( model, &iter ) ) do
     1986    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) do
    19871987        gtk_list_store_set( store, &iter, TRACKER_COL_WAS_UPDATED, FALSE, -1 );
    19881988    while( gtk_tree_model_iter_next( model, &iter ) );
     
    20562056
    20572057    /* step 5: remove trackers that have disappeared */
    2058     if( gtk_tree_model_get_iter_first( model, &iter ) ) {
     2058    if( gtk_tree_model_iter_nth_child( model, &iter, NULL, 0 ) ) {
    20592059        gboolean more = TRUE;
    20602060        while( more ) {
Note: See TracChangeset for help on using the changeset viewer.