aboutsummaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-03-23 16:01:16 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-03-23 16:01:16 -0300
commit86e8039a72646cd9192fd08a6f1771c90b872ff6 (patch)
treee0c68d303aba023fc44d8e9193e239cbf7ae97f9 /lmathlib.c
parent5a04f1851e0d42b4bcbb0af103490bc964e985aa (diff)
downloadlua-86e8039a72646cd9192fd08a6f1771c90b872ff6.tar.gz
lua-86e8039a72646cd9192fd08a6f1771c90b872ff6.tar.bz2
lua-86e8039a72646cd9192fd08a6f1771c90b872ff6.zip
Clock component removed from 'luaL_makeseed'
'clock' can be quite slow on some machines.
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lmathlib.c b/lmathlib.c
index f13cae4a..6d63950c 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -607,8 +607,8 @@ static int math_randomseed (lua_State *L) {
607 RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1)); 607 RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1));
608 lua_Unsigned n1, n2; 608 lua_Unsigned n1, n2;
609 if (lua_isnone(L, 1)) { 609 if (lua_isnone(L, 1)) {
610 n1 = luaL_makeseed(L); 610 n1 = luaL_makeseed(L); /* "random" seed */
611 n2 = I2UInt(state->s[0]); 611 n2 = I2UInt(nextrand(state->s)); /* in case seed is not that random... */
612 } 612 }
613 else { 613 else {
614 n1 = luaL_checkinteger(L, 1); 614 n1 = luaL_checkinteger(L, 1);