Merge pull request #2192 from dasMulli/random-seeding-improvements
authorPeter Marcu <Peter.Marcu@Microsoft.com>
Thu, 13 Oct 2016 21:55:50 +0000 (14:55 -0700)
committerGitHub <noreply@github.com>
Thu, 13 Oct 2016 21:55:50 +0000 (14:55 -0700)
System.Random: Parameterless constructor seeding improvement #1919

1  2 
src/mscorlib/src/System/Random.cs

@@@ -46,13 -47,19 +47,19 @@@ namespace System 
        //
        // Constructors
        //
-     
+       
+       /*=========================================================================================
+       **Action: Initializes a new instance of the Random class, using a default seed value
+       ===========================================================================================*/
        public Random() 
-         : this(Environment.TickCount) {
+         : this(GenerateSeed()) {
        }
-     
+       
+       /*=========================================================================================
+       **Action: Initializes a new instance of the Random class, using a specified seed value
+       ===========================================================================================*/
        public Random(int Seed) {
 -        int ii;
 +        int ii = 0;
          int mj, mk;
      
          //Initialize our Seed array.