@@ -24,36 +24,36 @@ import aux::crate_ctxt;
24
24
import aux:: add_node;
25
25
import middle:: tstate:: ann:: empty_ann;
26
26
27
- fn collect_ids_expr ( & @expr e , @mutable vec [ node_id] rs ) {
28
- vec :: push ( * rs, e. id ) ;
27
+ fn collect_ids_expr( & @expr e , @mutable node_id[ ] rs) {
28
+ * rs += ~ [ e. id ] ;
29
29
}
30
30
31
- fn collect_ids_block ( & block b, @mutable vec [ node_id] rs ) {
32
- vec :: push ( * rs, b. node . id ) ;
31
+ fn collect_ids_block( & block b, @mutable node_id[ ] rs) {
32
+ * rs += ~ [ b. node. id ] ;
33
33
}
34
34
35
- fn collect_ids_stmt ( & @stmt s , @mutable vec [ node_id] rs ) {
35
+ fn collect_ids_stmt( & @stmt s, @mutable node_id[ ] rs) {
36
36
alt ( s. node) {
37
37
case ( stmt_decl( _, ?id) ) {
38
38
log "node_id " + int:: str( id) ;
39
39
log_stmt( * s) ;
40
- vec :: push ( * rs, id ) ;
40
+ * rs += ~ [ id ] ;
41
41
}
42
42
case ( stmt_expr( _, ?id) ) {
43
43
log "node_id " + int:: str( id) ;
44
44
log_stmt( * s) ;
45
- vec :: push ( * rs, id ) ;
45
+ * rs += ~ [ id ] ;
46
46
}
47
47
case ( _) { }
48
48
}
49
49
}
50
50
51
- fn collect_ids_local ( & @local l , @mutable vec [ node_id] rs ) {
52
- vec :: push ( * rs, l. node . id ) ;
51
+ fn collect_ids_local( & @local l, @mutable node_id[ ] rs) {
52
+ * rs += ~ [ l. node. id] ;
53
53
}
54
54
55
55
fn node_ids_in_fn( & _fn f, & vec[ ty_param] tps, & span sp, & fn_ident i,
56
- node_id id, @mutable vec [ node_id] rs ) {
56
+ node_id id, @mutable node_id[ ] rs) {
57
57
auto collect_ids = walk:: default_visitor( ) ;
58
58
collect_ids =
59
59
rec( visit_expr_pre=bind collect_ids_expr( _, rs) ,
@@ -63,7 +63,7 @@ fn node_ids_in_fn(&_fn f, &vec[ty_param] tps, &span sp, &fn_ident i,
63
63
walk:: walk_fn( collect_ids, f, tps, sp, i, id) ;
64
64
}
65
65
66
- fn init_vecs ( & crate_ctxt ccx, & vec [ node_id] node_ids , uint len) {
66
+ fn init_vecs( & crate_ctxt ccx, & node_id[ ] node_ids, uint len) {
67
67
for ( node_id i in node_ids) {
68
68
log int:: str( i) + " |-> " + uint:: str( len) ;
69
69
add_node( ccx, i, empty_ann( len) ) ;
@@ -72,7 +72,7 @@ fn init_vecs(&crate_ctxt ccx, &vec[node_id] node_ids, uint len) {
72
72
73
73
fn visit_fn( & crate_ctxt ccx, uint num_constraints, & _fn f, & vec[ ty_param] tps,
74
74
& span sp, & fn_ident i, node_id id) {
75
- let @mutable vec [ node_id] node_ids = @mutable [ ] ;
75
+ let @mutable node_id[ ] node_ids = @mutable ~ [ ] ;
76
76
node_ids_in_fn( f, tps, sp, i, id, node_ids) ;
77
77
auto node_id_vec = * node_ids;
78
78
init_vecs( ccx, node_id_vec, num_constraints) ;
0 commit comments