X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Fstrlist.c;h=875ee231f30e109a2a971ae03a710fbb6947a465;hb=57cc32650e4efd0ae3c6f9b2422a63c06dbdbe88;hp=dee9269058f85c122e4ad866c9802618d7691da4;hpb=7e4bf3c72dfb5be45dcb6479c5fa69c0dde80449;p=apps%2Fpfixtools.git diff --git a/postlicyd/strlist.c b/postlicyd/strlist.c index dee9269..875ee23 100644 --- a/postlicyd/strlist.c +++ b/postlicyd/strlist.c @@ -219,7 +219,6 @@ static bool strlist_filter_constructor(filter_t *filter) trie = strlist_create(current, reverse, lock); PARSE_CHECK(trie != NULL, "cannot load string list from %s", current); - trie_inspect(trie, false); array_add(config->tries, trie); array_add(config->weights, weight); array_add(config->reverses, reverse); @@ -320,18 +319,18 @@ static filter_result_t strlist_filter(const filter_t *filter, const query_t *que return HTK_ABORT; } #define LOOKUP(Flag, Field) \ - if (config->match_ ## Flag) { \ - const int len = m_strlen(query->Field); \ - strlist_copy(normal, query->Field, len, false); \ - strlist_copy(reverse, query->Field, len, true); \ - for (int i = 0 ; i < config->tries.len ; ++i) { \ - const int weight = array_elt(config->weights, i); \ - const trie_t *trie = array_elt(config->tries, i); \ - const bool rev = array_elt(config->reverses, i); \ - if (trie_lookup(trie, rev ? reverse : normal)) { \ - sum += weight; \ - } \ - } \ + if (config->match_ ## Flag) { \ + const int len = m_strlen(query->Field); \ + strlist_copy(normal, query->Field, len, false); \ + strlist_copy(reverse, query->Field, len, true); \ + for (uint32_t i = 0 ; i < config->tries.len ; ++i) { \ + const int weight = array_elt(config->weights, i); \ + const trie_t *trie = array_elt(config->tries, i); \ + const bool rev = array_elt(config->reverses, i); \ + if (trie_lookup(trie, rev ? reverse : normal)) { \ + sum += weight; \ + } \ + } \ } if (config->is_email) { LOOKUP(sender, sender);