Remove many shared pointers

Mostly just low-haning fruit, i.e. function arguments that were @ even
though & would work just as well.

Reduces librustc.so size by 200k when compiling without -O, by 100k when
compiling with -O.
This commit is contained in:
Philipp Brüschweiler
2013-06-27 15:04:22 +02:00
parent 0bad3e62b4
commit 7295a6da92
50 changed files with 388 additions and 427 deletions

View File

@@ -565,11 +565,11 @@ pub fn walk_pat(pat: @pat, it: &fn(@pat) -> bool) -> bool {
}
pub trait EachViewItem {
pub fn each_view_item(&self, f: @fn(@ast::view_item) -> bool) -> bool;
pub fn each_view_item(&self, f: @fn(&ast::view_item) -> bool) -> bool;
}
impl EachViewItem for ast::crate {
fn each_view_item(&self, f: @fn(@ast::view_item) -> bool) -> bool {
fn each_view_item(&self, f: @fn(&ast::view_item) -> bool) -> bool {
let broke = @mut false;
let vtor: visit::vt<()> = visit::mk_simple_visitor(@visit::SimpleVisitor {
visit_view_item: |vi| { *broke = f(vi); }, ..*visit::default_simple_visitor()
@@ -579,7 +579,7 @@ impl EachViewItem for ast::crate {
}
}
pub fn view_path_id(p: @view_path) -> node_id {
pub fn view_path_id(p: &view_path) -> node_id {
match p.node {
view_path_simple(_, _, id) |
view_path_glob(_, id) |