talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit c4f76652a26ea6eb23825eb46d9f55d86d436d38
parent c68c1827c899253b1532e8f66d9d791640e67e06
Author: Colin Leroy <colin@colino.net>
Date:   Thu, 25 Oct 2012 07:42:08 +0000

2012-10-25 [colin]	3.8.1cvs104

	* src/textview.c
	* src/textview.h
		Avoid strlen() on big buffers, use precomputed length instead
		it reduces cost of textview_write_line() from 32% to 3% for
		big messages. Patch by Igor Mammedov
	* AUTHORS
	* src/gtk/authors.h
		Add Igor

Diffstat:
MAUTHORS | 1+
MChangeLog | 11+++++++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/gtk/authors.h | 1+
Msrc/textview.c | 4+++-
Msrc/textview.h | 1+
7 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -291,3 +291,4 @@ contributors (in addition to the above; based on Changelog) Andreas Rönnquist Sean Buckheister Natanael Copa + Igor Mammedov diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,14 @@ +2012-10-25 [colin] 3.8.1cvs104 + + * src/textview.c + * src/textview.h + Avoid strlen() on big buffers, use precomputed length instead + it reduces cost of textview_write_line() from 32% to 3% for + big messages. Patch by Igor Mammedov + * AUTHORS + * src/gtk/authors.h + Add Igor + 2012-10-24 [mones] 3.8.1cvs103 * src/advsearch.c diff --git a/PATCHSETS b/PATCHSETS @@ -4478,3 +4478,4 @@ ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 claws-mail.desktop; ) > 3.8.1cvs101.patchset ( cvs diff -u -r 1.100.2.84 -r 1.100.2.85 AUTHORS; cvs diff -u -r 1.23.2.39 -r 1.23.2.40 src/crash.c; cvs diff -u -r 1.1.2.80 -r 1.1.2.81 src/gtk/authors.h; ) > 3.8.1cvs102.patchset ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/advsearch.c; ) > 3.8.1cvs103.patchset +( cvs diff -u -r 1.100.2.85 -r 1.100.2.86 AUTHORS; cvs diff -u -r 1.96.2.249 -r 1.96.2.250 src/textview.c; cvs diff -u -r 1.12.2.35 -r 1.12.2.36 src/textview.h; cvs diff -u -r 1.1.2.81 -r 1.1.2.82 src/gtk/authors.h; ) > 3.8.1cvs104.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=103 +EXTRA_VERSION=104 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/gtk/authors.h b/src/gtk/authors.h @@ -174,6 +174,7 @@ static char *CONTRIBS_LIST[] = { "Alessandro Maestri", "Maki", "Jindrich Makovicka", +"Igor Mammedov", "Tim Mann", "Ivan Francolin Martinez", "HIRAMATSU Masami", diff --git a/src/textview.c b/src/textview.c @@ -1637,6 +1637,7 @@ do_quote: uri = g_new0(ClickableText, 1); uri->uri = g_strdup(""); uri->data = g_strdup(buf); + uri->data_len = strlen(uri->data); uri->start = gtk_text_iter_get_offset(&iter); uri->is_quote = TRUE; uri->quote_level = real_quotelevel; @@ -1669,11 +1670,12 @@ do_quote: textview->prev_quote_level = -1; goto do_quote; } - e_len = lasturi->data ? strlen(lasturi->data):0; + e_len = lasturi->data ? lasturi->data_len:0; n_len = strlen(buf); lasturi->data = g_realloc((gchar *)lasturi->data, e_len + n_len + 1); strcpy((gchar *)lasturi->data + e_len, buf); *((gchar *)lasturi->data + e_len + n_len) = '\0'; + lasturi->data_len += n_len; } } } else { diff --git a/src/textview.h b/src/textview.h @@ -35,6 +35,7 @@ struct _ClickableText gchar *filename; gpointer data; + gint data_len; guint start; guint end;