mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
csync: use a unordered_map for the FileMap
Saves more than 10% of csync_update on LargeSyncBench
This commit is contained in:
parent
2ec8194d01
commit
3107e63040
1 changed files with 4 additions and 2 deletions
|
@ -32,7 +32,8 @@
|
|||
#ifndef _CSYNC_PRIVATE_H
|
||||
#define _CSYNC_PRIVATE_H
|
||||
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <QHash>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <sqlite3.h>
|
||||
|
@ -70,7 +71,8 @@ enum csync_replica_e {
|
|||
* @brief csync public structure
|
||||
*/
|
||||
struct OCSYNC_EXPORT csync_s {
|
||||
class FileMap : public std::map<QByteArray, std::unique_ptr<csync_file_stat_t>> {
|
||||
struct FileMapHash { uint operator()(const QByteArray &a) const { return qHash(a); } };
|
||||
class FileMap : public std::unordered_map<QByteArray, std::unique_ptr<csync_file_stat_t>, FileMapHash> {
|
||||
public:
|
||||
csync_file_stat_t *findFile(const QByteArray &key) const {
|
||||
auto it = find(key);
|
||||
|
|
Loading…
Reference in a new issue