mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Really prefer more efficient hash functions over less efficient ones.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2018-09-08 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
|
Really prefer more efficient hash functions over less efficient ones.
|
||||||
|
Reported by Frank Wojcik <frankw@touristinresidence.com> in
|
||||||
|
<https://savannah.gnu.org/patch/?9561>.
|
||||||
|
* src/search.cc (Search::find_positions): In step 4, make sure a less
|
||||||
|
efficient hash function does not replace a more efficient one. Also,
|
||||||
|
include i3 = -1 among the search.
|
||||||
|
|
||||||
2018-09-08 Bruno Haible <bruno@clisp.org>
|
2018-09-08 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
Correct width of columns when outputting the asso_values array.
|
Correct width of columns when outputting the asso_values array.
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ Search::find_positions ()
|
|||||||
for (int i2 = imax; i2 >= -1; i2--)
|
for (int i2 = imax; i2 >= -1; i2--)
|
||||||
if (current.contains (i2) && !mandatory.contains (i2) && i2 != i1)
|
if (current.contains (i2) && !mandatory.contains (i2) && i2 != i1)
|
||||||
{
|
{
|
||||||
for (int i3 = imax; i3 >= 0; i3--)
|
for (int i3 = imax; i3 >= -1; i3--)
|
||||||
if (!current.contains (i3))
|
if (!current.contains (i3))
|
||||||
{
|
{
|
||||||
Positions tryal = current;
|
Positions tryal = current;
|
||||||
@@ -435,7 +435,7 @@ Search::find_positions ()
|
|||||||
function. */
|
function. */
|
||||||
if (try_duplicates_count < best_duplicates_count
|
if (try_duplicates_count < best_duplicates_count
|
||||||
|| (try_duplicates_count == best_duplicates_count
|
|| (try_duplicates_count == best_duplicates_count
|
||||||
&& (i1 == -1 || i2 == -1 || i3 >= 0)))
|
&& (i1 == -1 || i2 == -1) && i3 >= 0))
|
||||||
{
|
{
|
||||||
best = tryal;
|
best = tryal;
|
||||||
best_duplicates_count = try_duplicates_count;
|
best_duplicates_count = try_duplicates_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user