]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fts: tr29 tokenizer cleanup - Avoid unnecessary goto.
authorTimo Sirainen <tss@iki.fi>
Mon, 1 Jun 2015 18:33:11 +0000 (21:33 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 1 Jun 2015 18:33:11 +0000 (21:33 +0300)
src/lib-fts/fts-tokenizer-generic.c

index 4d29cb6fe878a877ba38ad20feca39774b6fae9a..054ad8f8368727699a1a46ade7adff80a1b465ef 100644 (file)
@@ -597,17 +597,16 @@ uni_found_word_boundary(struct generic_fts_tokenizer *tok, enum letter_type lt)
 {
        /* No rule knows what to do with just one char, except the linebreaks
           we eat away (above) anyway. */
-       if (tok->prev_letter == LETTER_TYPE_NONE)
-               goto false_out;
-
-       if (letter_fns[lt].fn(tok))
-               return TRUE;
+       if (tok->prev_letter != LETTER_TYPE_NONE) {
+               if (letter_fns[lt].fn(tok))
+                       return TRUE;
+       }
 
- false_out:
-       /* Extend and format types are ignored. */
-       if (lt == LETTER_TYPE_EXTEND || lt == LETTER_TYPE_FORMAT)
-               return FALSE;
-       add_prev_letter(tok,lt);
+       if (lt == LETTER_TYPE_EXTEND || lt == LETTER_TYPE_FORMAT) {
+               /* These types are completely ignored. */
+       } else {
+               add_prev_letter(tok,lt);
+       }
        return FALSE;
 }