diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-09-01 13:03:01 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-09-01 13:04:47 +1000 |
| commit | 4c4eb61c188347f6956dfcd075e190c79f0a970c (patch) | |
| tree | 4a39400d0dc21244066c77ab07d930848beeed04 /src/line_modification.hh | |
| parent | b24be99fa3e684201faed534c5988940d561df35 (diff) | |
Introduce FunctionRef to replace std::function when not storing
std::function is not necessary when we just want to pass a type
erased callback that does not need to own its target. FunctionRef
provides that functionality for a much lower compile time cost.
Diffstat (limited to 'src/line_modification.hh')
| -rw-r--r-- | src/line_modification.hh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/line_modification.hh b/src/line_modification.hh index 5cb4d350..b9c9cfcd 100644 --- a/src/line_modification.hh +++ b/src/line_modification.hh @@ -7,8 +7,6 @@ #include "range.hh" #include "vector.hh" -#include <functional> - namespace Kakoune { @@ -40,7 +38,7 @@ struct LineRangeSet : private Vector<LineRange, MemoryDomain::Highlight> void reset(LineRange range) { Base::operator=({range}); } void update(ConstArrayView<LineModification> modifs); - void add_range(LineRange range, std::function<void (LineRange)> on_new_range); + void add_range(LineRange range, FunctionRef<void (LineRange)> on_new_range); void remove_range(LineRange range); }; |
