MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / cleanup_queues

Method cleanup_queues

editor/src/dispatcher.rs:106–113  ·  view source on GitHub ↗

If the deepest queues (higher index in queues list) are now empty (after being popped from) then remove them

(&mut self, leave_last: bool)

Source from the content-addressed store, hash-verified

104
105 // If the deepest queues (higher index in queues list) are now empty (after being popped from) then remove them
106 fn cleanup_queues(&mut self, leave_last: bool) {
107 while self.message_queues.last().filter(|queue| queue.is_empty()).is_some() {
108 if leave_last && self.message_queues.len() == 1 {
109 break;
110 }
111 self.message_queues.pop();
112 }
113 }
114
115 /// Add a message to a queue so that it can be executed.
116 /// If `process_after_all_current` is set, all currently queued messages (including children) will be processed first.

Callers 1

handle_messageMethod · 0.80

Calls 4

is_someMethod · 0.80
popMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected