Skip to content

Commit

Permalink
Remove useless loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Jun 19, 2024
1 parent 8370f06 commit 590df84
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions packages/dioxus-blitz/src/documents/dioxus_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,22 @@ impl From<DioxusDocument> for Document {
}
impl DocumentLike for DioxusDocument {
fn poll(&mut self, mut cx: std::task::Context) -> bool {
loop {
{
let fut = self.vdom.wait_for_work();
pin_mut!(fut);

match fut.poll_unpin(&mut cx) {
std::task::Poll::Ready(_) => {}
std::task::Poll::Pending => return false,
}
}
{
let fut = self.vdom.wait_for_work();
pin_mut!(fut);

self.vdom.render_immediate(&mut MutationWriter {
doc: &mut self.inner,
state: &mut self.vdom_state,
});
return true;
match fut.poll_unpin(&mut cx) {
std::task::Poll::Ready(_) => {},
std::task::Poll::Pending => return false,
}
}

self.vdom.render_immediate(&mut MutationWriter {
doc: &mut self.inner,
state: &mut self.vdom_state,
});

true
}

fn handle_event(&mut self, event: blitz_dom::events::RendererEvent) -> bool {
Expand Down

0 comments on commit 590df84

Please sign in to comment.