Browse Source

String class >> random more intent revealing.

Herby Vojčík 5 years ago
parent
commit
3ae6357be4
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lang/src/Kernel-Collections.js
  2. 1 1
      lang/src/Kernel-Collections.st

+ 2 - 2
lang/src/Kernel-Collections.js

@@ -7051,7 +7051,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);;
+return ((10+22*Math.random())/32).toString(32).slice(2);;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"random",{},$globals.String.a$cls)});
@@ -7059,7 +7059,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "random\x0a\x09\x22Returns random alphanumeric string beginning with letter\x22\x0a\x09<inlineJS: 'return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);'>",
+source: "random\x0a\x09\x22Returns random alphanumeric string beginning with letter\x22\x0a\x09<inlineJS: 'return ((10+22*Math.random())/32).toString(32).slice(2);'>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 1 - 1
lang/src/Kernel-Collections.st

@@ -1628,7 +1628,7 @@ value: aUTFCharCode
 
 random
 	"Returns random alphanumeric string beginning with letter"
-	<inlineJS: 'return (Math.random()*(22/32)+(10/32)).toString(32).slice(2);'>
+	<inlineJS: 'return ((10+22*Math.random())/32).toString(32).slice(2);'>
 !
 
 randomNotIn: aString