In tsearch code, remove !(A && B) via restructuring, for clarity
authorBruce Momjian <bruce@momjian.us>
Fri, 9 Nov 2007 01:32:22 +0000 (01:32 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 9 Nov 2007 01:32:22 +0000 (01:32 +0000)
src/backend/tsearch/dict_thesaurus.c

index 84ef0b3846be5426b1cdf3d973f6c0f3bdde8985..e4e3b5f79e8d3fd94c34a1b8ba725425d9d532a8 100644 (file)
@@ -418,14 +418,13 @@ compileTheLexeme(DictThesaurus * d)
                                                                        Int32GetDatum(strlen(d->wrds[i].lexeme)),
                                                                                                         PointerGetDatum(NULL)));
 
-               if (!(ptr && ptr->lexeme))
+               if (!ptr)
+                       elog(ERROR, "thesaurus word-sample \"%s\" isn't recognized by subdictionary (rule %d)",
+                                d->wrds[i].lexeme, d->wrds[i].entries->idsubst + 1);
+               else if (!(ptr->lexeme))
                {
-                       if (!ptr)
-                               elog(ERROR, "thesaurus word-sample \"%s\" isn't recognized by subdictionary (rule %d)",
-                                        d->wrds[i].lexeme, d->wrds[i].entries->idsubst + 1);
-                       else
-                               elog(NOTICE, "thesaurus word-sample \"%s\" is recognized as stop-word, assign any stop-word (rule %d)",
-                                        d->wrds[i].lexeme, d->wrds[i].entries->idsubst + 1);
+                       elog(NOTICE, "thesaurus word-sample \"%s\" is recognized as stop-word, assign any stop-word (rule %d)",
+                                d->wrds[i].lexeme, d->wrds[i].entries->idsubst + 1);
 
                        newwrds = addCompiledLexeme(newwrds, &nnw, &tnm, NULL, d->wrds[i].entries, 0);
                }