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/highlighter_group.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/highlighter_group.hh')
| -rw-r--r-- | src/highlighter_group.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/highlighter_group.hh b/src/highlighter_group.hh index 1502b796..658b85be 100644 --- a/src/highlighter_group.hh +++ b/src/highlighter_group.hh @@ -21,7 +21,7 @@ public: HighlighterGroup(HighlightPass passes) : Highlighter{passes} {} bool has_children() const override { return true; } - void add_child(String name, std::unique_ptr<Highlighter>&& hl, bool override = false) override; + void add_child(String name, UniquePtr<Highlighter>&& hl, bool override = false) override; void remove_child(StringView id) override; Highlighter& get_child(StringView path) override; @@ -34,7 +34,7 @@ protected: void do_highlight(HighlightContext context, DisplayBuffer& display_buffer, BufferRange range) override; void do_compute_display_setup(HighlightContext context, DisplaySetup& setup) const override; - using HighlighterMap = HashMap<String, std::unique_ptr<Highlighter>, MemoryDomain::Highlight>; + using HighlighterMap = HashMap<String, UniquePtr<Highlighter>, MemoryDomain::Highlight>; HighlighterMap m_highlighters; }; |
