Skip to content

Commit

Permalink
Use unlikely() optimization on sys_rand_seeded flag
Browse files Browse the repository at this point in the history
  • Loading branch information
droe committed Oct 14, 2018
1 parent 78f7a1d commit 9647790
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,14 @@ sys_rand_seed(void) {

uint16_t
sys_rand16(void) {
if (!sys_rand_seeded)
if (unlikely(!sys_rand_seeded))
sys_rand_seed();
return random();
}

uint32_t
sys_rand32(void) {
if (!sys_rand_seeded)
if (unlikely(!sys_rand_seeded))
sys_rand_seed();
return random();
}
Expand Down

0 comments on commit 9647790

Please sign in to comment.