]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fts: fixup misuse of hash_table_insert()
authorBaofeng Wang <baofeng.wang@dovecot.fi>
Tue, 17 May 2016 08:42:30 +0000 (11:42 +0300)
committerGitLab <gitlab@git.dovecot.net>
Fri, 3 Jun 2016 13:08:38 +0000 (16:08 +0300)
Instead use hash_table_update() to replace value when a key exsists.

src/lib-fts/fts-filter-stopwords.c

index 8b7a1067a5566fc23511152cc800833485e03c2e..82723f85a699620060fb8653314da0570ee50c99 100644 (file)
@@ -41,7 +41,7 @@ static int fts_filter_stopwords_read_list(struct fts_filter_stopwords *filter,
                if (strcspn(line, STOPWORDS_DISALLOWED_CHARS) < len)
                        continue;
                word = p_strndup(filter->pool, line, len);
-               hash_table_insert(filter->stopwords, word, word);
+               hash_table_update(filter->stopwords, word, word);
        }
 
        if (input->stream_errno != 0) {