[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH 01/19] util: virRandomInt: remove temporary variable



Signed-off-by: Ján Tomko <jtomko redhat com>
---
 src/util/virrandom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index 0487b4e70b..6417232e3a 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -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;
 }
 
 
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]