Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 5324cd2

Browse files
authored
[Core] Use long in StringTable for better codegen (#8633)
Part of VSTS #977400 - Review usages of Interlocked
1 parent 2397d71 commit 5324cd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringTable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private struct Entry
6464
private int _localRandom = Environment.TickCount;
6565

6666
// same as above but for users that go directly with unbuffered shared cache.
67-
private static int s_sharedRandom = Environment.TickCount;
67+
private static long s_sharedRandom = Environment.TickCount;
6868

6969
public StringTable()
7070
{
@@ -657,7 +657,7 @@ private int LocalNextRandom()
657657

658658
private static int SharedNextRandom()
659659
{
660-
return Interlocked.Increment(ref StringTable.s_sharedRandom);
660+
return (int)Interlocked.Increment(ref StringTable.s_sharedRandom);
661661
}
662662

663663
internal static bool TextEquals(string array, string text, int start, int length)

0 commit comments

Comments
 (0)