File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 717ac3df77a5bddca02391a7bd34be3edb4099fe
2
+ refs/heads/master: e066bae56e850b5885cc9b73d44131a27ad68b1d
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ fn populate_type_store(&ctxt cx) {
378
378
intern ( cx, ty_task, none[ str] ) ;
379
379
intern ( cx, ty_type, none[ str] ) ;
380
380
intern ( cx, ty_bot, none[ str] ) ;
381
- assert ( vec :: len ( cx. ts . vect ) == idx_first_others) ;
381
+ assert ( ivec :: len ( cx. ts . vect ) == idx_first_others) ;
382
382
}
383
383
384
384
fn mk_rcache ( ) -> creader_cache {
Original file line number Diff line number Diff line change 1
1
// An "interner" is a data structure that associates values with uint tags and
2
2
// allows bidirectional lookup; i.e. given a value, one can easily find the
3
3
// type, and vice versa.
4
- import std:: vec ;
4
+ import std:: ivec ;
5
5
import std:: map;
6
6
import std:: map:: hashmap;
7
7
import std:: map:: hashfn;
@@ -12,24 +12,24 @@ import std::option::some;
12
12
13
13
type interner [ T ] =
14
14
rec ( hashmap[ T , uint] map,
15
- mutable vec [ T ] vect,
15
+ mutable T [ ] vect,
16
16
hashfn[ T ] hasher,
17
17
eqfn[ T ] eqer) ;
18
18
19
19
fn mk[ T ] ( hashfn[ T ] hasher, eqfn[ T ] eqer) -> interner[ T ] {
20
20
auto m = map:: mk_hashmap[ T , uint] ( hasher, eqer) ;
21
- let vec[ T ] vect = [ ] ;
22
- ret rec( map=m, mutable vect=vect, hasher=hasher, eqer=eqer) ;
21
+ ret rec( map=m, mutable vect=~[ ] , hasher=hasher, eqer=eqer) ;
23
22
}
24
23
fn intern[ T ] ( & interner[ T ] itr, & T val) -> uint {
25
24
alt ( itr. map . find ( val) ) {
26
25
case ( some ( ?idx) ) { ret idx; }
27
26
case ( none) {
28
- auto new_idx = vec :: len[ T ] ( itr. vect ) ;
27
+ auto new_idx = ivec :: len[ T ] ( itr. vect ) ;
29
28
itr. map . insert ( val, new_idx) ;
30
- itr. vect += [ val] ;
29
+ itr. vect += ~ [ val] ;
31
30
ret new_idx;
32
31
}
33
32
}
34
33
}
35
34
fn get[ T ] ( & interner[ T ] itr, uint idx) -> T { ret itr. vect . ( idx ) ; }
35
+
You can’t perform that action at this time.
0 commit comments