diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-07-08 11:43:17 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-07-08 12:07:33 +1000 |
| commit | ce1d512a0c1922ab5f43f28e7bae573508c98601 (patch) | |
| tree | 7af8effd6b00c304cda1c87f657a0014fcdae2ae /src/utils.hh | |
| parent | fea08fc18d268ace4f843ec2b57cc33e36562098 (diff) | |
Replace std::unique_ptr with a custom implementation
<memory> is a costly header we can avoid by just implementing
UniquePtr ourselves, which is a pretty straightforward in modern
C++, this saves around 10% of the compilation time here.
Diffstat (limited to 'src/utils.hh')
| -rw-r--r-- | src/utils.hh | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/utils.hh b/src/utils.hh index b517735f..ba8cf737 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -2,8 +2,7 @@ #define utils_hh_INCLUDED #include "assert.hh" - -#include <memory> +#include "unique_ptr.hh" namespace Kakoune { @@ -127,14 +126,6 @@ private: bool m_condition; }; -// *** Misc helper functions *** - -template<typename T> -bool operator== (const std::unique_ptr<T>& lhs, T* rhs) -{ - return lhs.get() == rhs; -} - template<typename T> const T& clamp(const T& val, const T& min, const T& max) { |
