organize includes

This commit is contained in:
Akash Mozumdar 2018-11-04 21:19:00 -05:00
parent 0c7103964d
commit 3b5ad6edfe
9 changed files with 8 additions and 24 deletions

View File

@ -5,7 +5,6 @@
#include "textthread.h" #include "textthread.h"
#include "host.h" #include "host.h"
#include "const.h" #include "const.h"
#include <regex>
TextThread::TextThread(ThreadParam tp, HookParam hp, std::wstring name) : handle(threadCounter++), name(name), tp(tp), hp(hp) {} TextThread::TextThread(ThreadParam tp, HookParam hp, std::wstring name) : handle(threadCounter++), name(name), tp(tp), hp(hp) {}

View File

@ -6,7 +6,6 @@
#include "common.h" #include "common.h"
#include "types.h" #include "types.h"
#include <unordered_set>
class TextThread class TextThread
{ {

View File

@ -1,9 +1,5 @@
#include "../extension.h" #include "../extension.h"
#include <winhttp.h> #include <winhttp.h>
#include <vector>
#include <mutex>
#include <algorithm>
#include <regex>
#include <QInputDialog> #include <QInputDialog>
#include <QTimer> #include <QTimer>

View File

@ -1,9 +1,6 @@
#pragma once #pragma once
#define WIN32_LEAN_AND_MEAN #include "common.h"
#include <windows.h>
#include <cstdint>
#include <string>
struct InfoForExtension struct InfoForExtension
{ {

View File

@ -1,10 +1,6 @@
#include "../extension.h" #include "../extension.h"
#include <winhttp.h> #include <winhttp.h>
#include <ctime> #include <ctime>
#include <vector>
#include <mutex>
#include <algorithm>
#include <regex>
#include <QInputDialog> #include <QInputDialog>
#include <QTimer> #include <QTimer>

View File

@ -1,10 +1,9 @@
#ifndef WINDOW_H #ifndef WINDOW_H
#define WINDOW_H #define WINDOW_H
#include "common.h"
#include <QMainWindow> #include <QMainWindow>
#include <QString> #include <QString>
#include <regex>
#include <mutex>
namespace Ui namespace Ui
{ {

View File

@ -1,6 +1,4 @@
#include "../extension.h" #include "../extension.h"
#include <set>
#include <mutex>
bool RemoveRepeatedChars(std::wstring& sentence) bool RemoveRepeatedChars(std::wstring& sentence)
{ {
@ -44,11 +42,11 @@ bool RemoveCyclicRepeats(std::wstring& sentence)
bool RemoveRepeatedSentences(std::wstring& sentence, int64_t handle) bool RemoveRepeatedSentences(std::wstring& sentence, int64_t handle)
{ {
static std::set<std::pair<int64_t, std::wstring>> seenSentences; static std::unordered_map<int64_t, std::unordered_set<std::wstring>> seenSentences;
static std::mutex m; static std::mutex m;
std::lock_guard<std::mutex> l(m); std::lock_guard<std::mutex> l(m);
if (seenSentences.count({ handle, sentence }) != 0) Skip(); if (seenSentences[handle].count(sentence)) Skip();
seenSentences.insert({ handle, sentence }); seenSentences[handle].insert(sentence);
return false; return false;
} }

View File

@ -1,9 +1,7 @@
#ifndef WINDOW_H #ifndef WINDOW_H
#define WINDOW_H #define WINDOW_H
#include <unordered_map> #include "common.h"
#include <unordered_set>
#include <mutex>
#include <QMainWindow> #include <QMainWindow>
#include <QListWidget> #include <QListWidget>

View File

@ -5,8 +5,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include <functional> #include <functional>
#include <algorithm> #include <algorithm>
#include <regex>
#include <memory> #include <memory>
#include <optional> #include <optional>
#include <thread> #include <thread>