diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-13 14:28:26 -0400 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-13 14:28:26 -0400 |
commit | 97cbd98bc5bb99bd1363ba1ae87074afcef926a4 (patch) | |
tree | 47471b826ca4880f831c200f614e5c87f6ee8c1e /node/Multicaster.hpp | |
parent | 3e49337d9a773a5d805a908bc093b5d72985d8d9 (diff) | |
download | infinitytier-97cbd98bc5bb99bd1363ba1ae87074afcef926a4.tar.gz infinitytier-97cbd98bc5bb99bd1363ba1ae87074afcef926a4.zip |
Compile fixes, integration of fast PRNG.
Diffstat (limited to 'node/Multicaster.hpp')
-rw-r--r-- | node/Multicaster.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp index 42c92aab..187054f0 100644 --- a/node/Multicaster.hpp +++ b/node/Multicaster.hpp @@ -234,7 +234,7 @@ public: // network graph likely to be hops away from the original origin of the // message. for(unsigned int i=0;i<ZT_MULTICAST_BLOOM_FILTER_DECAY_RATE;++i) - bf.decay(); + bf.decay((unsigned int)prng.next32()); { Mutex::Lock _l(_multicastMemberships_m); @@ -261,8 +261,7 @@ public: // Skip some fraction of entries so that our sampling will be randomly distributed, // since there is no other good way to sample randomly from a map. if (numEntriesPermittedToSkip) { - double skipThis = (double)(Utils::randomInt<uint32_t>()) / 4294967296.0; - if (skipThis <= skipWhatFraction) { + if (prng.nextDouble() <= skipWhatFraction) { --numEntriesPermittedToSkip; ++channelMemberEntry; continue; |