diff options
author | ache <ache@FreeBSD.org> | 2016-05-29 16:39:28 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2016-05-29 16:39:28 +0000 |
commit | 06e4e4310f4ec7530e2ac8421e95d5eb846297b5 (patch) | |
tree | cbf8b4e83074120264e526dbc8de0c667c141d64 /lib/libc | |
parent | fa9d379051eb8023069a3ad724760edeb5851510 (diff) | |
download | FreeBSD-src-06e4e4310f4ec7530e2ac8421e95d5eb846297b5.zip FreeBSD-src-06e4e4310f4ec7530e2ac8421e95d5eb846297b5.tar.gz |
Micro optimize: C standard guarantees that right shift for unsigned value
fills left bits with zero, and we have exact 32bit unsigned value
(uint32_t), so there is no reason to add "& 0x7fffffff" here.
MFC after: 1 week
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdlib/random.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index 5b8b5cf..fe8fc86 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -430,7 +430,7 @@ random(void) */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */ + i = *f >> 1; /* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; |