Skip to content

Commit 7ab9d2b

Browse files
committed
Refactor mt19937_extract function
This commit is to improve maintainability.
1 parent f72066e commit 7ab9d2b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/map/mt19937.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ uint64_t mt19937_extract(void)
3434
generate_numbers();
3535

3636
uint64_t y = MT[index];
37-
y = y ^ (y >> 11);
38-
y = y ^ ((y << 7) & 0x9d2c5680ULL);
39-
y = y ^ ((y << 15) & 0xefc60000ULL);
40-
y = y ^ (y >> 18);
37+
y ^= y >> 11;
38+
y ^= (y << 7) & 0x9d2c5680ULL;
39+
y ^= (y << 15) & 0xefc60000ULL;
40+
y ^= y >> 18;
4141

4242
index = (index + 1) % 624;
4343
return y;

0 commit comments

Comments
 (0)