diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-23 16:01:16 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-23 16:01:16 -0300 |
commit | 86e8039a72646cd9192fd08a6f1771c90b872ff6 (patch) | |
tree | e0c68d303aba023fc44d8e9193e239cbf7ae97f9 /lmathlib.c | |
parent | 5a04f1851e0d42b4bcbb0af103490bc964e985aa (diff) | |
download | lua-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |