# HG changeset patch # User Eric Warmenhoven # Date 983307700 0 # Node ID d3ff7d80b8fba998b16c52050883671504ff01fc # Parent e85a3a0e09755aa245cfdb3ff6a2e8eea1d9c729 [gaim-migrate @ 1529] faster is_smiley check committer: Tailor Script diff -r e85a3a0e0975 -r d3ff7d80b8fb src/gtkimhtml.c --- a/src/gtkimhtml.c Tue Feb 27 18:41:11 2001 +0000 +++ b/src/gtkimhtml.c Tue Feb 27 21:01:40 2001 +0000 @@ -186,6 +186,8 @@ gdk_cursor_destroy (imhtml->arrow_cursor); g_hash_table_destroy (imhtml->smiley_hash); + if (imhtml->smiley_start) + g_string_free (imhtml->smiley_start, TRUE); if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -1480,6 +1482,12 @@ if (strlen (text) > imhtml->smax) imhtml->smax = strlen (text); + if (!imhtml->smiley_start) + imhtml->smiley_start = g_string_new (""); + + if (!strchr (imhtml->smiley_start->str, text [0])) + imhtml->smiley_start = g_string_append_c (imhtml->smiley_start, text [0]); + if (xpm == NULL) g_hash_table_remove (imhtml->smiley_hash, text); else @@ -1805,6 +1813,9 @@ g_return_val_if_fail (GTK_IS_IMHTML (imhtml), 0); g_return_val_if_fail (text != NULL, 0); + if (!imhtml->smiley_start || !strchr (imhtml->smiley_start->str, text [0])) + return 0; + tmp = g_malloc (imhtml->smax + 1); for (i = imhtml->smin; i <= imhtml->smax; i++) { diff -r e85a3a0e0975 -r d3ff7d80b8fb src/gtkimhtml.h --- a/src/gtkimhtml.h Tue Feb 27 18:41:11 2001 +0000 +++ b/src/gtkimhtml.h Tue Feb 27 21:01:40 2001 +0000 @@ -72,6 +72,7 @@ gboolean comments; GHashTable *smiley_hash; + GString *smiley_start; gint smin, smax; };