speed improvements
authorColin Leroy <colin@colino.net>
Fri, 31 Jan 2003 11:01:51 +0000 (11:01 +0000)
committerColin Leroy <colin@colino.net>
Fri, 31 Jan 2003 11:01:51 +0000 (11:01 +0000)
ChangeLog.claws
configure.ac
src/addr_compl.c
src/msgcache.c
src/summaryview.c

index 7b45ac6..1ae5206 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-31 [colin]     0.8.9claws24
+       
+       * src/addr_compl.c
+         src/summaryview.c
+         src/msgcache.c
+               little speed improvements
+
 2003-01-31 [colin]     0.8.9claws23
 
        * src/summaryview.c
index 5883d70..afb70b8 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws23
+EXTRA_VERSION=claws24
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 39ad650..32aa5f4 100644 (file)
@@ -151,7 +151,7 @@ static void add_address1(const char *str, address_entry *ae)
        g_strdown(ce1->string);
        ce1->ref = ae;
 
-       g_completion_list = g_list_append(g_completion_list, ce1);
+       g_completion_list = g_list_prepend(g_completion_list, ce1);
 }
 
 /* add_address() - adds address to the completion list. this function looks
@@ -170,7 +170,7 @@ static gint add_address(const gchar *name, const gchar *address, const gchar *al
        ae->name    = g_strdup(name);
        ae->address = g_strdup(address);                
 
-       g_address_list    = g_list_append(g_address_list,    ae);
+       g_address_list    = g_list_prepend(g_address_list,    ae);
 
        add_address1(name, ae);
        add_address1(address, ae);
@@ -183,6 +183,8 @@ static gint add_address(const gchar *name, const gchar *address, const gchar *al
  */ 
 static void read_address_book(void) {  
        addressbook_load_completion( add_address );
+       g_address_list = g_list_reverse(g_address_list);
+       g_completion_list = g_list_reverse(g_completion_list);
 }
 
 /* start_address_completion() - returns the number of addresses 
index 9bdf3a3..9ccd729 100644 (file)
@@ -311,13 +311,12 @@ void msgcache_read_mark(MsgCache *cache, const gchar *mark_file)
 #define WRITE_CACHE_DATA(data, fp) \
 { \
        gint len; \
- \
-       if (data == NULL || (len = strlen(data)) == 0) { \
+       if (data == NULL) \
                len = 0; \
-               WRITE_CACHE_DATA_INT(len, fp); \
-       } else { \
+       else \
                len = strlen(data); \
-               WRITE_CACHE_DATA_INT(len, fp); \
+       WRITE_CACHE_DATA_INT(len, fp); \
+       if (len > 0) { \
                fwrite(data, len, 1, fp); \
        } \
 }
index b04b74b..eb6be15 100644 (file)
@@ -993,7 +993,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                             || MSG_IS_LOCKED(msginfo->flags)
                             || CURRENTLY_DISPLAYED(msginfo))
                             && !MSG_IS_IGNORE_THREAD(msginfo->flags))
-                           not_killed = g_slist_append(not_killed, msginfo);
+                           not_killed = g_slist_prepend(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
                }
@@ -1046,12 +1046,12 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                        }
                        if (search_type != S_SEARCH_EXTENDED) {
                                if (searched_header && strcasestr(searched_header, search_string) != NULL)
-                                       not_killed = g_slist_append(not_killed, msginfo);
+                                       not_killed = g_slist_prepend(not_killed, msginfo);
                                else
                                        procmsg_msginfo_free(msginfo);
                        } else {
                                if ((tmp_list != NULL) && matcherlist_match(tmp_list, msginfo))
-                                       not_killed = g_slist_append(not_killed, msginfo);
+                                       not_killed = g_slist_prepend(not_killed, msginfo);
                                else
                                        procmsg_msginfo_free(msginfo);
                        }
@@ -1077,7 +1077,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                        MsgInfo * msginfo = (MsgInfo *) cur->data;
 
                        if (msginfo->score > kill_score)
-                               not_killed = g_slist_append(not_killed, msginfo);
+                               not_killed = g_slist_prepend(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
                }
@@ -2264,7 +2264,6 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        } else {
                gchar *text[N_SUMMARY_COLS];
 
-               mlist = g_slist_reverse(mlist);
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
 
@@ -2284,7 +2283,6 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                                             msginfo->subject,
                                             node);
                }
-               mlist = g_slist_reverse(mlist);
        }
 
        if (prefs_common.enable_hscrollbar &&