diff --git a/chatterino.pro b/chatterino.pro index 8380ef9b..4f7573c2 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -527,7 +527,6 @@ HEADERS += \ src/util/IncognitoBrowser.hpp \ src/util/InitUpdateButton.hpp \ src/util/IrcHelpers.hpp \ - src/util/IsBigEndian.hpp \ src/util/LayoutCreator.hpp \ src/util/LayoutHelper.hpp \ src/util/NuulsUploader.hpp \ @@ -536,7 +535,6 @@ HEADERS += \ src/util/PostToThread.hpp \ src/util/QObjectRef.hpp \ src/util/QStringHash.hpp \ - src/util/rangealgorithm.hpp \ src/util/RapidjsonHelpers.hpp \ src/util/RapidJsonSerializeQString.hpp \ src/util/RatelimitBucket.hpp \ diff --git a/src/Application.cpp b/src/Application.cpp index 234d3d7c..47d56f3c 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -32,7 +32,6 @@ #include "singletons/Updates.hpp" #include "singletons/WindowManager.hpp" #include "util/Helpers.hpp" -#include "util/IsBigEndian.hpp" #include "util/PostToThread.hpp" #include "util/RapidjsonHelpers.hpp" #include "widgets/Notebook.hpp" diff --git a/src/BrowserExtension.cpp b/src/BrowserExtension.cpp index f004b659..dad0ac2a 100644 --- a/src/BrowserExtension.cpp +++ b/src/BrowserExtension.cpp @@ -58,19 +58,6 @@ namespace { auto size = *reinterpret_cast(size_c); -#if 0 - bool bigEndian = isBigEndian(); - // To avoid breaking strict-aliasing rules and potentially inducing undefined behaviour, the following code can be run instead - uint32_t size = 0; - if (bigEndian) { - size = size_c[3] | static_cast(size_c[2]) << 8 | - static_cast(size_c[1]) << 16 | static_cast(size_c[0]) << 24; - } else { - size = size_c[0] | static_cast(size_c[1]) << 8 | - static_cast(size_c[2]) << 16 | static_cast(size_c[3]) << 24; - } -#endif - std::unique_ptr buffer(new char[size + 1]); std::cin.read(buffer.get(), size); *(buffer.get() + size) = '\0'; diff --git a/src/util/IsBigEndian.hpp b/src/util/IsBigEndian.hpp deleted file mode 100644 index 20e516b7..00000000 --- a/src/util/IsBigEndian.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace chatterino { - -bool isBigEndian() -{ - int test = 1; - char *p = reinterpret_cast(&test); - - return p[0] == 0; -} - -} // namespace chatterino diff --git a/src/util/rangealgorithm.hpp b/src/util/rangealgorithm.hpp deleted file mode 100644 index 03c7e19f..00000000 --- a/src/util/rangealgorithm.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include - -namespace chatterino { -namespace util { - - template - typename Container::iterator find_if(Container &container, - UnaryPredicate pred) - { - return std::find_if(container.begin(), container.end(), pred); - } - - template - bool any_of(Container &container, UnaryPredicate pred) - { - return std::any_of(container.begin(), container.end(), pred); - } - -} // namespace util -} // namespace chatterino