libcore: minor code cleanup.

This is minor and probably completely inconsequential to performance,
but I find vec::map to be more clear than vec::each and a push.
This commit is contained in:
Erick Tryzelaar
2012-10-18 09:14:11 -07:00
parent 95423d28f2
commit a7ecde3323
8 changed files with 16 additions and 25 deletions

View File

@@ -90,9 +90,7 @@ fn attr_meta(attr: ast::attribute) -> @ast::meta_item { @attr.node.value }
// Get the meta_items from inside a vector of attributes
fn attr_metas(attrs: ~[ast::attribute]) -> ~[@ast::meta_item] {
let mut mitems = ~[];
for attrs.each |a| { mitems.push(attr_meta(*a)); }
return mitems;
do attrs.map |a| { attr_meta(*a) }
}
fn desugar_doc_attr(attr: &ast::attribute) -> ast::attribute {