more cleanup

This commit is contained in:
Jonathan Kelley committed 2021-08-31 12:28:44 -04:00
1 parent 9f99f46cfd
commit 5cbdc571e3
10 files changed
+148 -192

No files matched your search

+1 -14
View File
@@ -4,7 +4,7 @@ use crate::innerlude::*;
///
/// This iterator is useful when it's important to load the next real root onto the top of the stack for operations like
/// "InsertBefore".
pub struct RealChildIterator<'a> {
pub(crate) struct RealChildIterator<'a> {
scopes: &'a ResourcePool,
// Heuristcally we should never bleed into 4 completely nested fragments/components
@@ -20,19 +20,6 @@ impl<'a> RealChildIterator<'a> {
stack: smallvec::smallvec![(0, starter)],
}
}
pub fn new_from_slice(nodes: &'a [VNode<'a>], scopes: &'a ResourcePool) -> Self {
let mut stack = smallvec::smallvec![];
for node in nodes {
stack.push((0, node));
}
Self { scopes, stack }
}
// keep the memory around
pub fn reset_with(&mut self, node: &'a VNode<'a>) {
self.stack.clear();
self.stack.push((0, node));
}
}
impl<'a> Iterator for RealChildIterator<'a> {