summaryrefslogtreecommitdiff
path: root/src/diff.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2025-07-08 11:43:17 +1000
committerMaxime Coste <mawww@kakoune.org>2025-07-08 12:07:33 +1000
commitce1d512a0c1922ab5f43f28e7bae573508c98601 (patch)
tree7af8effd6b00c304cda1c87f657a0014fcdae2ae /src/diff.hh
parentfea08fc18d268ace4f843ec2b57cc33e36562098 (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/diff.hh')
-rw-r--r--src/diff.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/diff.hh b/src/diff.hh
index 2f582b16..bcca655a 100644
--- a/src/diff.hh
+++ b/src/diff.hh
@@ -7,7 +7,7 @@
#include <algorithm>
#include <functional>
-#include <memory>
+#include "unique_ptr.hh"
namespace Kakoune
{
@@ -175,7 +175,7 @@ template<typename IteratorA, typename IteratorB, typename OnDiff, typename Equal
void for_each_diff(IteratorA a, int N, IteratorB b, int M, OnDiff&& on_diff, Equal&& eq = Equal{})
{
const int max = 2 * (N + M) + 1;
- std::unique_ptr<int[]> data(new int[2*max]);
+ UniquePtr<int[]> data(new int[2*max]);
constexpr int cost_limit = 1000;
Diff last{};