From 35c6f56e47f3303352efda3c5013ede0580c7a0f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 21 Jan 2013 09:32:36 +0100 Subject: [PATCH] mtrand: Simplify mt_init_by_seed_time() Just call mt_init_by_seed_rand() instead of re-implementing it. Signed-off-by: Tobias Klauser --- src/mtrand.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/mtrand.c b/src/mtrand.c index 8cddf82c..3ac659e1 100644 --- a/src/mtrand.c +++ b/src/mtrand.c @@ -47,15 +47,7 @@ void mt_init_by_seed_rand(unsigned long s) void mt_init_by_seed_time(void) { - int i; - x[0] = ((unsigned long) time(NULL)) & 0xffffffffUL; - for (i = 1; i < N; ++i) { - x[i] = (1812433253UL * (x[i - 1] ^ (x[i - 1] >> 30)) + i) & - 0xffffffffUL; - } - p0 = x; - p1 = x + 1; - pm = x + M; + mt_init_by_seed_rand((unsigned long) time(NULL)); } void mt_init_by_seed_array(unsigned long key[], int len) -- 2.11.4.GIT