radicle-term: Optimize impl of VStack::children()
This way the Iterator::size_hint() function can be used by the Extend::extend() implementation, which might safe reallocations for the underlying buffer. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
93388e366c
commit
19c484e956
|
|
@ -77,10 +77,9 @@ impl<'a> VStack<'a> {
|
|||
I: IntoIterator<Item = Box<dyn Element>>,
|
||||
{
|
||||
let mut vstack = self;
|
||||
|
||||
for child in children.into_iter() {
|
||||
vstack = vstack.child(child);
|
||||
}
|
||||
vstack
|
||||
.rows
|
||||
.extend(children.into_iter().map(|e| Row::Element(Box::new(e))));
|
||||
vstack
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue