diff options
author | Radek Doulik <rodo@ximian.com> | 2001-11-05 21:03:07 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2001-11-05 21:03:07 +0800 |
commit | 16fb895cb041530084b226f9a524da385bb45e03 (patch) | |
tree | dc2bfe125a7cfc9c9937d6a41c90b7ba289b7840 | |
parent | ea7b076e8a195f6e92e430ef9ef417815a34bead (diff) | |
download | gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar.gz gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar.bz2 gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar.lz gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar.xz gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.tar.zst gsoc2013-evolution-16fb895cb041530084b226f9a524da385bb45e03.zip |
use hash table to eliminate duplicates
2001-11-02 Radek Doulik <rodo@ximian.com>
* e-msg-composer.c (add_inlined_images): use hash table to
eliminate duplicates
svn path=/trunk/; revision=14587
-rw-r--r-- | composer/ChangeLog | 5 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 74ccb2f27d..97ce5674bb 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,8 @@ +2001-11-02 Radek Doulik <rodo@ximian.com> + + * e-msg-composer.c (add_inlined_images): use hash table to + eliminate duplicates + 2001-11-02 <NotZed@Ximian.com> * e-msg-composer.c (e_msg_composer_set_enable_autosave): New diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index ec3fea9578..aeca4b58cb 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -271,13 +271,19 @@ static void add_inlined_images (EMsgComposer *composer, CamelMultipart *multipart) { GList *d = composer->current_images; + GHashTable *added; + added = g_hash_table_new (g_direct_hash, g_direct_equal); while (d) { CamelMimePart *part = d->data; - camel_multipart_add_part (multipart, part); + if (!g_hash_table_lookup (added, part)) { + camel_multipart_add_part (multipart, part); + g_hash_table_insert (added, part, part); + } d = d->next; } + g_hash_table_destroy (added); } /* This functions builds a CamelMimeMessage for the message that the user has |