From ce1d512a0c1922ab5f43f28e7bae573508c98601 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 8 Jul 2025 11:43:17 +1000 Subject: Replace std::unique_ptr with a custom implementation 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. --- src/regex_impl.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/regex_impl.hh') diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 8853ced5..d62261ec 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -169,8 +169,8 @@ struct CompiledRegex : UseMemoryDomain bool map[count]; }; - std::unique_ptr forward_start_desc; - std::unique_ptr backward_start_desc; + UniquePtr forward_start_desc; + UniquePtr backward_start_desc; }; String dump_regex(const CompiledRegex& program); @@ -751,7 +751,7 @@ private: return res; } - std::unique_ptr m_data; + UniquePtr m_data; uint32_t m_capacity_mask = 0; // Maximum capacity should be 2*instruction count, so 65536 uint32_t m_current = 0; uint32_t m_next_begin = 0; -- cgit v1.2.3