1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

Omit the multicompare code output if it is not needed.

This commit is contained in:
Bruno Haible
2003-04-14 10:18:32 +00:00
parent 6bbdde4f5f
commit 5e30c2698e
3 changed files with 6 additions and 14 deletions

View File

@@ -1,5 +1,9 @@
2003-01-01 Bruno Haible <bruno@clisp.org>
* src/output.cc (Output::output_lookup_function_body): Omit the
multicompare code section and its variables when it is not used.
* tests/chill.exp: Regenerated.
* src/output.c (Output_Compare::output_firstchar_comparison): New
method.
(Output_Compare_Strcmp::output_comparison,

View File

@@ -1334,7 +1334,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
printf (" if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)\n"
" {\n");
if (option[DUP])
if (option[DUP] && _total_duplicates > 0)
{
if (option[LENTABLE])
printf (" register %s%s *lengthptr;\n",
@@ -1358,7 +1358,7 @@ Output::output_lookup_function_body (const Output_Compare& comparison) const
output_switches (_head, num_switches, switch_size, _min_hash_value, _max_hash_value, 10);
if (option[DUP])
if (option[DUP] && _total_duplicates > 0)
{
int indent = 8;
printf ("%*s return 0;\n"

View File

@@ -446,8 +446,6 @@ in_word_set (str, len)
if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
{
register struct resword *wordptr;
register struct resword *wordendptr;
register struct resword *resword;
switch (key - 4)
@@ -1354,16 +1352,6 @@ in_word_set (str, len)
goto compare;
}
return 0;
multicompare:
while (wordptr < wordendptr)
{
register const char *s = wordptr->name;
if (*str == *s && !strcmp (str + 1, s + 1))
return wordptr;
wordptr++;
}
return 0;
compare:
{
register const char *s = resword->name;