Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Merge changes from TFS - #1298

Merged
jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs
May 18, 2016
Merged

jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs

Conversation

@dotnet-bot

Copy link
Copy Markdown
Collaborator

No description provided.

CR: morganb, yzha, trylek

The primality tests in DictionaryBase and FixedHashTable classes were flawed.  First, IsPrime(x) incorrectly returned true for squares of prime numbers (false positives).  Second, for very big arguments the multiplication might overflow, which caused the loop to run many times longer than required.  Third, for x == int.MaxValue the function incorrectly returned false (false negative).

Instead of fixing the loop condition, I simply copied the table of pre-calculated prime numbers from the CoreFX version of the HashHelpers class as Vance and Tomas suggested during the code review.

Also put back the linker switch that I incorrectly removed in changeset 1603970 (not related to the fix above).

[tfs-changeset: 1606004]
@jkotas
jkotas merged commit 1234e04 into dotnet:nmirror May 18, 2016
@dotnet-bot
dotnet-bot deleted the from-tfs branch May 18, 2016 22:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants