Commit 3ba26659 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/21.08'

parents dfbd8fa4 de3e5212
Pipeline #73976 passed with stage
in 6 minutes and 7 seconds
......@@ -520,14 +520,14 @@ void TransportManagerPrivate::slotTransportsChanged()
int TransportManagerPrivate::createId() const
{
QVector<int> usedIds;
usedIds.reserve(1 + transports.count());
usedIds.reserve(transports.size());
for (Transport *t : std::as_const(transports)) {
usedIds << t->id();
}
usedIds << 0; // 0 is default for unknown
int newId;
do {
newId = QRandomGenerator::global()->generate();
// 0 is default for unknown, so use 1 as lower value accepted
newId = QRandomGenerator::global()->bounded(1, RAND_MAX);
} while (usedIds.contains(newId));
return newId;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment