Restore current component at end of function

Since it's not necessary to restore the saved value of current_component
before calling the flush_callbacks list, we'll move the restore to the
very end of the function, which makes sense as saving it is the first
thing the function does.
pull/6920/head
Robin Munn 5 years ago
parent 195aed1451
commit 91415bf819

@ -69,14 +69,13 @@ export function flush() {
render_callbacks.length = 0; render_callbacks.length = 0;
} while (dirty_components.length); } while (dirty_components.length);
set_current_component(saved_component);
while (flush_callbacks.length) { while (flush_callbacks.length) {
flush_callbacks.pop()(); flush_callbacks.pop()();
} }
update_scheduled = false; update_scheduled = false;
seen_callbacks.clear(); seen_callbacks.clear();
set_current_component(saved_component);
} }
function update($$) { function update($$) {

Loading…
Cancel
Save