Clock component removed from 'luaL_makeseed'

'clock' can be quite slow on some machines.
This commit is contained in:
Roberto Ierusalimschy
2023-03-23 16:01:16 -03:00
parent 5a04f1851e
commit 86e8039a72
4 changed files with 9 additions and 11 deletions

View File

@@ -607,8 +607,8 @@ static int math_randomseed (lua_State *L) {
RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1));
lua_Unsigned n1, n2;
if (lua_isnone(L, 1)) {
n1 = luaL_makeseed(L);
n2 = I2UInt(state->s[0]);
n1 = luaL_makeseed(L); /* "random" seed */
n2 = I2UInt(nextrand(state->s)); /* in case seed is not that random... */
}
else {
n1 = luaL_checkinteger(L, 1);