Renamed private members
This commit is contained in:
+14
-13
@@ -10,17 +10,14 @@ namespace chatterino {
|
||||
|
||||
class DebugCount
|
||||
{
|
||||
static QMap<QString, int64_t> counts;
|
||||
static std::mutex mut;
|
||||
|
||||
public:
|
||||
static void increase(const QString &name)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mut);
|
||||
std::lock_guard<std::mutex> lock(mut_);
|
||||
|
||||
auto it = counts.find(name);
|
||||
if (it == counts.end()) {
|
||||
counts.insert(name, 1);
|
||||
auto it = counts_.find(name);
|
||||
if (it == counts_.end()) {
|
||||
counts_.insert(name, 1);
|
||||
} else {
|
||||
reinterpret_cast<int64_t &>(it.value())++;
|
||||
}
|
||||
@@ -28,11 +25,11 @@ public:
|
||||
|
||||
static void decrease(const QString &name)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mut);
|
||||
std::lock_guard<std::mutex> lock(mut_);
|
||||
|
||||
auto it = counts.find(name);
|
||||
if (it == counts.end()) {
|
||||
counts.insert(name, -1);
|
||||
auto it = counts_.find(name);
|
||||
if (it == counts_.end()) {
|
||||
counts_.insert(name, -1);
|
||||
} else {
|
||||
reinterpret_cast<int64_t &>(it.value())--;
|
||||
}
|
||||
@@ -40,10 +37,10 @@ public:
|
||||
|
||||
static QString getDebugText()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mut);
|
||||
std::lock_guard<std::mutex> lock(mut_);
|
||||
|
||||
QString text;
|
||||
for (auto it = counts.begin(); it != counts.end(); it++) {
|
||||
for (auto it = counts_.begin(); it != counts_.end(); it++) {
|
||||
text += it.key() + ": " + QString::number(it.value()) + "\n";
|
||||
}
|
||||
return text;
|
||||
@@ -53,6 +50,10 @@ public:
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
static QMap<QString, int64_t> counts_;
|
||||
static std::mutex mut_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user