Fix PubSub client creation/pending topic resolving (#3037)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
pajlada
2021-07-25 17:13:04 +02:00
committed by GitHub
parent 33d1837f4f
commit 770b9f263b
4 changed files with 128 additions and 28 deletions
+28
View File
@@ -27,6 +27,20 @@ public:
reinterpret_cast<int64_t &>(it.value())++;
}
}
static void increase(const QString &name, const int64_t &amount)
{
auto counts = counts_.access();
auto it = counts->find(name);
if (it == counts->end())
{
counts->insert(name, amount);
}
else
{
reinterpret_cast<int64_t &>(it.value()) += amount;
}
}
static void decrease(const QString &name)
{
@@ -42,6 +56,20 @@ public:
reinterpret_cast<int64_t &>(it.value())--;
}
}
static void decrease(const QString &name, const int64_t &amount)
{
auto counts = counts_.access();
auto it = counts->find(name);
if (it == counts->end())
{
counts->insert(name, -amount);
}
else
{
reinterpret_cast<int64_t &>(it.value()) -= amount;
}
}
static QString getDebugText()
{