OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
676b475
)
use qrand() for random bits in QUuid::createUuid()
author
Ivailo Monev
<xakepa10@gmail.com>
Sat, 30 Jan 2021 16:19:34 +0000
(18:19 +0200)
committer
Ivailo Monev
<xakepa10@gmail.com>
Sat, 30 Jan 2021 16:19:34 +0000
(18:19 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/plugin/quuid.cpp
patch
|
blob
|
history
diff --git
a/src/core/plugin/quuid.cpp
b/src/core/plugin/quuid.cpp
index
f014619
..
d9b41c2
100644
(file)
--- a/
src/core/plugin/quuid.cpp
+++ b/
src/core/plugin/quuid.cpp
@@
-771,13
+771,7
@@
QUuid QUuid::createUuid()
uint *data = &(result.data1);
static const int intbits = sizeof(int)*8;
- static int randbits = 0;
- if (!randbits) {
- int r = 0;
- int max = RAND_MAX;
- do { ++r; } while ((max=max>>1));
- randbits = r;
- }
+ static const int randbits = qrand();
int chunks = 16 / sizeof(uint);
while (chunks--) {