Use util::str::str_join in more places

Instead of intermediate allocations of `Vec`s, we should utilize
`str_join` which operates on iterators
This commit is contained in:
Corey Farwell 2015-09-28 19:57:06 -04:00
parent 2857e547be
commit f14f09e886
4 changed files with 7 additions and 10 deletions

View file

@ -98,7 +98,7 @@ use std::sync::mpsc::channel;
use string_cache::{Atom, QualName};
use time;
use url::Url;
use util::str::{DOMString, split_html_space_chars};
use util::str::{DOMString, split_html_space_chars, str_join};
#[derive(JSTraceable, PartialEq, HeapSizeOf)]
pub enum IsHTMLDocument {
@ -1443,7 +1443,7 @@ impl DocumentMethods for Document {
Some(ref title) => {
// Steps 3-4.
let value = Node::collect_text_contents(title.r().children());
split_html_space_chars(&value).collect::<Vec<_>>().join(" ")
str_join(split_html_space_chars(&value), " ")
},
}
}