mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
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:
@@ -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());
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user