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

index 5532947be8ea5d5a214772b5cb81755768fc1acd..7a0ae4afd3e40d6d0a43734ac802c7cd9f8815e9 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.4 2007/09/18 15:03:23 teodor Exp $
+ *   $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.5 2007/11/09 01:32:22 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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);
        }