Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a739e7

Browse files
committed
fuzzystrmatch: Remove dead code
Remnants left behind bya323edeReviewed-by: Michael Paquier <michael.paquier@gmail.com>Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
1 parent90627cf commit5a739e7

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

‎contrib/fuzzystrmatch/fuzzystrmatch.c

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@ soundex_code(char letter)
9494
****************************************************************************/
9595

9696

97-
/**************************************************************************
98-
my constants -- constants I like
99-
100-
Probably redundant.
101-
102-
***************************************************************************/
103-
104-
#defineMETA_ERRORFALSE
105-
#defineMETA_SUCCESSTRUE
106-
#defineMETA_FAILUREFALSE
107-
108-
10997
/*I add modifications to the traditional metaphone algorithm that you
11098
might find in books. Define this if you want metaphone to behave
11199
traditionally */
@@ -116,7 +104,7 @@ soundex_code(char letter)
116104
#defineTH'0'
117105

118106
staticcharLookahead(char*word,inthow_far);
119-
staticint_metaphone(char*word,intmax_phonemes,char**phoned_word);
107+
staticvoid_metaphone(char*word,intmax_phonemes,char**phoned_word);
120108

121109
/* Metachar.h ... little bits about characters for metaphone */
122110

@@ -272,7 +260,6 @@ metaphone(PG_FUNCTION_ARGS)
272260
size_tstr_i_len=strlen(str_i);
273261
intreqlen;
274262
char*metaph;
275-
intretval;
276263

277264
/* return an empty string if we receive one */
278265
if (!(str_i_len>0))
@@ -296,17 +283,8 @@ metaphone(PG_FUNCTION_ARGS)
296283
(errcode(ERRCODE_ZERO_LENGTH_CHARACTER_STRING),
297284
errmsg("output cannot be empty string")));
298285

299-
300-
retval=_metaphone(str_i,reqlen,&metaph);
301-
if (retval==META_SUCCESS)
302-
PG_RETURN_TEXT_P(cstring_to_text(metaph));
303-
else
304-
{
305-
/* internal error */
306-
elog(ERROR,"metaphone: failure");
307-
/* keep the compiler quiet */
308-
PG_RETURN_NULL();
309-
}
286+
_metaphone(str_i,reqlen,&metaph);
287+
PG_RETURN_TEXT_P(cstring_to_text(metaph));
310288
}
311289

312290

@@ -362,7 +340,7 @@ Lookahead(char *word, int how_far)
362340
#defineIsbreak(c)(!isalpha((unsigned char) (c)))
363341

364342

365-
staticint
343+
staticvoid
366344
_metaphone(char*word,/* IN */
367345
intmax_phonemes,
368346
char**phoned_word)/* OUT */
@@ -404,7 +382,7 @@ _metaphone(char *word,/* IN */
404382
if (Curr_Letter=='\0')
405383
{
406384
End_Phoned_Word;
407-
returnMETA_SUCCESS;/* For testing */
385+
return;
408386
}
409387
}
410388

@@ -721,7 +699,7 @@ _metaphone(char *word,/* IN */
721699

722700
End_Phoned_Word;
723701

724-
return (META_SUCCESS);
702+
return;
725703
}/* END metaphone */
726704

727705

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp