dovecot-2.2: lib-fts: tr29 tokenizer cleanup - Avoid unnecessary...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 1 19:01:24 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/4a72ef26dbad
changeset: 18776:4a72ef26dbad
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 01 21:33:11 2015 +0300
description:
lib-fts: tr29 tokenizer cleanup - Avoid unnecessary goto.

diffstat:

 src/lib-fts/fts-tokenizer-generic.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (30 lines):

diff -r 7e3f4fa82dfe -r 4a72ef26dbad src/lib-fts/fts-tokenizer-generic.c
--- a/src/lib-fts/fts-tokenizer-generic.c	Mon Jun 01 21:28:42 2015 +0300
+++ b/src/lib-fts/fts-tokenizer-generic.c	Mon Jun 01 21:33:11 2015 +0300
@@ -597,17 +597,16 @@
 {
 	/* 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 (tok->prev_letter != LETTER_TYPE_NONE) {
+		if (letter_fns[lt].fn(tok))
+			return TRUE;
+	}
 
-	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;
 }
 


More information about the dovecot-cvs mailing list