From 3b5ad6edfe6ca8f80381ecc66e6b4d6990a8edf4 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 4 Nov 2018 21:19:00 -0500 Subject: [PATCH] organize includes --- GUI/host/textthread.cc | 1 - GUI/host/textthread.h | 1 - extensions/bingtranslate/bingtranslate.cpp | 4 ---- extensions/extension.h | 5 +---- extensions/googletranslate/googletranslate.cpp | 4 ---- extensions/regexfilter/window.h | 3 +-- extensions/removerepeat/removerepeat.cpp | 8 +++----- extensions/threadlinker/window.h | 4 +--- include/common.h | 2 ++ 9 files changed, 8 insertions(+), 24 deletions(-) diff --git a/GUI/host/textthread.cc b/GUI/host/textthread.cc index 9deb240..038eb99 100644 --- a/GUI/host/textthread.cc +++ b/GUI/host/textthread.cc @@ -5,7 +5,6 @@ #include "textthread.h" #include "host.h" #include "const.h" -#include TextThread::TextThread(ThreadParam tp, HookParam hp, std::wstring name) : handle(threadCounter++), name(name), tp(tp), hp(hp) {} diff --git a/GUI/host/textthread.h b/GUI/host/textthread.h index e4f273d..e09b12f 100644 --- a/GUI/host/textthread.h +++ b/GUI/host/textthread.h @@ -6,7 +6,6 @@ #include "common.h" #include "types.h" -#include class TextThread { diff --git a/extensions/bingtranslate/bingtranslate.cpp b/extensions/bingtranslate/bingtranslate.cpp index fd7d5c7..1675ee3 100644 --- a/extensions/bingtranslate/bingtranslate.cpp +++ b/extensions/bingtranslate/bingtranslate.cpp @@ -1,9 +1,5 @@ #include "../extension.h" #include -#include -#include -#include -#include #include #include diff --git a/extensions/extension.h b/extensions/extension.h index 7731410..7c0129f 100644 --- a/extensions/extension.h +++ b/extensions/extension.h @@ -1,9 +1,6 @@ #pragma once -#define WIN32_LEAN_AND_MEAN -#include -#include -#include +#include "common.h" struct InfoForExtension { diff --git a/extensions/googletranslate/googletranslate.cpp b/extensions/googletranslate/googletranslate.cpp index 563d8c5..14f9764 100644 --- a/extensions/googletranslate/googletranslate.cpp +++ b/extensions/googletranslate/googletranslate.cpp @@ -1,10 +1,6 @@ #include "../extension.h" #include #include -#include -#include -#include -#include #include #include diff --git a/extensions/regexfilter/window.h b/extensions/regexfilter/window.h index 5a7fa49..704c624 100644 --- a/extensions/regexfilter/window.h +++ b/extensions/regexfilter/window.h @@ -1,10 +1,9 @@ #ifndef WINDOW_H #define WINDOW_H +#include "common.h" #include #include -#include -#include namespace Ui { diff --git a/extensions/removerepeat/removerepeat.cpp b/extensions/removerepeat/removerepeat.cpp index 0def122..3011361 100644 --- a/extensions/removerepeat/removerepeat.cpp +++ b/extensions/removerepeat/removerepeat.cpp @@ -1,6 +1,4 @@ #include "../extension.h" -#include -#include bool RemoveRepeatedChars(std::wstring& sentence) { @@ -44,11 +42,11 @@ bool RemoveCyclicRepeats(std::wstring& sentence) bool RemoveRepeatedSentences(std::wstring& sentence, int64_t handle) { - static std::set> seenSentences; + static std::unordered_map> seenSentences; static std::mutex m; std::lock_guard l(m); - if (seenSentences.count({ handle, sentence }) != 0) Skip(); - seenSentences.insert({ handle, sentence }); + if (seenSentences[handle].count(sentence)) Skip(); + seenSentences[handle].insert(sentence); return false; } diff --git a/extensions/threadlinker/window.h b/extensions/threadlinker/window.h index 46f4985..9a0df0d 100644 --- a/extensions/threadlinker/window.h +++ b/extensions/threadlinker/window.h @@ -1,9 +1,7 @@ #ifndef WINDOW_H #define WINDOW_H -#include -#include -#include +#include "common.h" #include #include diff --git a/include/common.h b/include/common.h index 11a649d..70b4d39 100644 --- a/include/common.h +++ b/include/common.h @@ -5,8 +5,10 @@ #include #include #include +#include #include #include +#include #include #include #include