mirror of
https://github.com/transmission/transmission.git
synced 2026-04-18 07:56:33 +01:00
refactor: prefer std::unordred_map over QHash (#5701)
* refactor: use std::unordered_map instead of QHash in RpcClient.cc * chore remove unused #include <QHash> * refactor: use std::unordered_map instead of QHash in FileTreeItem
This commit is contained in:
@@ -6,16 +6,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include "Utils.h" // for std::hash<QString>
|
||||
|
||||
class FileTreeItem
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(FileTreeItem)
|
||||
@@ -91,15 +93,15 @@ private:
|
||||
void getSubtreeWantedSize(uint64_t& have, uint64_t& total) const;
|
||||
double progress() const;
|
||||
uint64_t size() const;
|
||||
QHash<QString, int> const& getMyChildRows();
|
||||
std::unordered_map<QString, int> const& getMyChildRows() const;
|
||||
|
||||
FileTreeItem* parent_ = {};
|
||||
QHash<QString, int> child_rows_;
|
||||
mutable std::unordered_map<QString, int> child_rows_;
|
||||
std::vector<FileTreeItem*> children_;
|
||||
QString name_;
|
||||
uint64_t const total_size_ = {};
|
||||
uint64_t have_size_ = {};
|
||||
int first_unhashed_row_ = {};
|
||||
mutable int first_unhashed_row_ = {};
|
||||
int const file_index_ = {};
|
||||
int priority_ = {};
|
||||
bool is_wanted_ = {};
|
||||
|
||||
Reference in New Issue
Block a user