Make the list of blocked events const

These are events that have been queued but not yet fired. There's no
reason to modify the events after creating them. Mark them as const
to ensure that doesn't happen.
This commit is contained in:
ridiculousfish
2020-07-19 12:03:10 -07:00
parent 31e19db64a
commit dff4f140b0
2 changed files with 2 additions and 2 deletions

View File

@@ -291,7 +291,7 @@ void event_fire_delayed(parser_t &parser) {
// Do not invoke new event handlers if we are unwinding (#6649).
if (signal_check_cancel()) return;
std::vector<shared_ptr<event_t>> to_send;
std::vector<shared_ptr<const event_t>> to_send;
to_send.swap(ld.blocked_events);
assert(ld.blocked_events.empty());

View File

@@ -186,7 +186,7 @@ struct library_data_t {
const wchar_t *current_filename{};
/// List of events that have been sent but have not yet been delivered because they are blocked.
std::vector<shared_ptr<event_t>> blocked_events{};
std::vector<shared_ptr<const event_t>> blocked_events{};
/// A stack of fake values to be returned by builtin_commandline. This is used by the completion
/// machinery when wrapping: e.g. if `tig` wraps `git` then git completions need to see git on