From 86e8039a72646cd9192fd08a6f1771c90b872ff6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 23 Mar 2023 16:01:16 -0300 Subject: Clock component removed from 'luaL_makeseed' 'clock' can be quite slow on some machines. --- lmathlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lmathlib.c') 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) { 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); -- cgit v1.2.3-55-g6feb