Commit 0abcd2ef by Ian Lance Taylor

runtime: correct a logic error in hashmap growth.

The bug prevented maps to grow properly to sizes
larger than 1.3 million.

From Rémy Oudompheng.

From-SVN: r189766
parent 8dbe2ebd
...@@ -90,9 +90,9 @@ __go_map_next_prime (uintptr_t n) ...@@ -90,9 +90,9 @@ __go_map_next_prime (uintptr_t n)
/* Here LOW <= MID < HIGH. */ /* Here LOW <= MID < HIGH. */
if (prime_list[mid] < n) if (prime_list[mid] < n)
high = mid;
else if (prime_list[mid] > n)
low = mid + 1; low = mid + 1;
else if (prime_list[mid] > n)
high = mid;
else else
return n; return n;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment