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:
@@ -1,5 +1,9 @@
|
|||||||
2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
|
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/key-list.cc (Key_List::read_keys): Don't accept an empty key.
|
||||||
|
|
||||||
* src/Makefile.in (install, installdirs, uninstall): Respect
|
* src/Makefile.in (install, installdirs, uninstall): Respect
|
||||||
|
|||||||
@@ -1675,6 +1675,8 @@ Key_List::output_lookup_function_body (const Output_Compare& comparison)
|
|||||||
indent -= 4;
|
indent -= 4;
|
||||||
printf ("%*s }\n", indent, "");
|
printf ("%*s }\n", indent, "");
|
||||||
}
|
}
|
||||||
|
if (total_duplicates > 0)
|
||||||
|
{
|
||||||
printf ("%*s else if (index < -TOTAL_KEYWORDS)\n"
|
printf ("%*s else if (index < -TOTAL_KEYWORDS)\n"
|
||||||
"%*s {\n"
|
"%*s {\n"
|
||||||
"%*s register int offset = - 1 - TOTAL_KEYWORDS - index;\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",
|
printf ("%*s lengthptr++;\n",
|
||||||
indent, "");
|
indent, "");
|
||||||
printf ("%*s wordptr++;\n"
|
printf ("%*s wordptr++;\n"
|
||||||
"%*s }\n"
|
|
||||||
"%*s }\n"
|
"%*s }\n"
|
||||||
"%*s }\n",
|
"%*s }\n",
|
||||||
indent, "", indent, "", indent, "", indent, "");
|
indent, "", indent, "", indent, "");
|
||||||
|
}
|
||||||
|
printf ("%*s}\n",
|
||||||
|
indent, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user