1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Small optimization.

This commit is contained in:
Bruno Haible
2000-08-19 15:11:41 +00:00
parent 308891a090
commit 51e5c7f72c
2 changed files with 59 additions and 51 deletions

View File

@@ -1,5 +1,9 @@
2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* src/key-list.cc (Key_List::output_lookup_function_body): Avoid
emitting the loop for dealing with duplicates if
total_duplicates == 0.
* src/key-list.cc (Key_List::read_keys): Don't accept an empty key.
* src/Makefile.in (install, installdirs, uninstall): Respect

View File

@@ -1675,6 +1675,8 @@ Key_List::output_lookup_function_body (const Output_Compare& comparison)
indent -= 4;
printf ("%*s }\n", indent, "");
}
if (total_duplicates > 0)
{
printf ("%*s else if (index < -TOTAL_KEYWORDS)\n"
"%*s {\n"
"%*s register int offset = - 1 - TOTAL_KEYWORDS - index;\n",
@@ -1725,10 +1727,12 @@ Key_List::output_lookup_function_body (const Output_Compare& comparison)
printf ("%*s lengthptr++;\n",
indent, "");
printf ("%*s wordptr++;\n"
"%*s }\n"
"%*s }\n"
"%*s }\n",
indent, "", indent, "", indent, "", indent, "");
indent, "", indent, "", indent, "");
}
printf ("%*s}\n",
indent, "");
}
else
{