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/regex_impl.cc | |
| 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/regex_impl.cc')
| -rw-r--r-- | src/regex_impl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 8a46d833..f64fc7a9 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -1046,7 +1046,7 @@ private: template<RegexMode direction> [[gnu::noinline]] - std::unique_ptr<CompiledRegex::StartDesc> compute_start_desc() const + UniquePtr<CompiledRegex::StartDesc> compute_start_desc() const { CompiledRegex::StartDesc start_desc{}; if (compute_start_desc<direction>(0, start_desc) or @@ -1056,7 +1056,7 @@ private: if (std::count(std::begin(start_desc.map), std::end(start_desc.map), true) == 1) start_desc.start_byte = find(start_desc.map, true) - std::begin(start_desc.map); - return std::make_unique<CompiledRegex::StartDesc>(start_desc); + return make_unique_ptr<CompiledRegex::StartDesc>(start_desc); } void optimize(size_t begin, size_t end) |
