Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/subscription/Subscription.cpp

Issue 29690863: Issue 6360 - Add support of MSVS (Closed) Base URL: github.com:adblockplus/adblockpluscore
Patch Set: Created Feb. 6, 2018, 12:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | meson.build » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/subscription/Subscription.cpp
diff --git a/compiled/subscription/Subscription.cpp b/compiled/subscription/Subscription.cpp
index e83819de4ed6fbda419e42ab57200e38efbbe530..51211e9cb2d915c8e671d4c2765ac753965cea94 100644
--- a/compiled/subscription/Subscription.cpp
+++ b/compiled/subscription/Subscription.cpp
@@ -17,6 +17,7 @@
#include <cstdio>
#include <cstdlib>
+#include <random>
#include "Subscription.h"
#include "DownloadableSubscription.h"
@@ -95,11 +96,11 @@ Subscription* Subscription::FromID(const String& id)
if (id.empty())
{
// Generate a new random ID
- unsigned int seed = knownSubscriptions.size();
+ std::mt19937 gen(knownSubscriptions.size());
sergei 2018/02/06 13:07:29 It slightly differs from rand_r, what results in a
OwnedString randomID(u"~user~000000"_str);
do
{
- int number = rand_r(&seed);
+ int number = gen();
for (int i = randomID.length() - 6; i < randomID.length(); i++)
{
randomID[i] = '0' + (number % 10);
« no previous file with comments | « no previous file | meson.build » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld