mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 17:18:01 +03:00
util: virRandomInt: remove temporary variable
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5af89a77b0
commit
ec9b47e133
@ -92,8 +92,7 @@ uint32_t virRandomInt(uint32_t max)
|
||||
if ((max & (max - 1)) == 0)
|
||||
return virRandomBits(__builtin_ffs(max) - 1);
|
||||
|
||||
double val = virRandom();
|
||||
return val * max;
|
||||
return virRandom() * max;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user