diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-14 07:07:09 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-14 08:43:29 +0200 |
| commit | a02b10a0621adfe36eb3cc2e46f45fc7ccdb7ea2 (patch) | |
| tree | 86fe8ac57360a232b07c4303547194646129561a /src/libsyntax/util | |
| parent | 22c34f3c4cddea33b916eb92f8d7286b02b865a7 (diff) | |
| download | rust-a02b10a0621adfe36eb3cc2e46f45fc7ccdb7ea2.tar.gz rust-a02b10a0621adfe36eb3cc2e46f45fc7ccdb7ea2.zip | |
Refactored ast_map and friends, mainly to have Paths without storing them.
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/interner.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index fc3e55dcde2..aedff2d7854 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -21,16 +21,16 @@ use std::hashmap::HashMap; use std::rc::Rc; pub struct Interner<T> { - priv map: @RefCell<HashMap<T, Name>>, - priv vect: @RefCell<~[T]>, + priv map: RefCell<HashMap<T, Name>>, + priv vect: RefCell<~[T]>, } // when traits can extend traits, we should extend index<Name,T> to get [] impl<T:Eq + IterBytes + Hash + Freeze + Clone + 'static> Interner<T> { pub fn new() -> Interner<T> { Interner { - map: @RefCell::new(HashMap::new()), - vect: @RefCell::new(~[]), + map: RefCell::new(HashMap::new()), + vect: RefCell::new(~[]), } } @@ -123,18 +123,18 @@ impl RcStr { } // A StrInterner differs from Interner<String> in that it accepts -// references rather than @ ones, resulting in less allocation. +// &str rather than RcStr, resulting in less allocation. pub struct StrInterner { - priv map: @RefCell<HashMap<RcStr, Name>>, - priv vect: @RefCell<~[RcStr]>, + priv map: RefCell<HashMap<RcStr, Name>>, + priv vect: RefCell<~[RcStr]>, } // when traits can extend traits, we should extend index<Name,T> to get [] impl StrInterner { pub fn new() -> StrInterner { StrInterner { - map: @RefCell::new(HashMap::new()), - vect: @RefCell::new(~[]), + map: RefCell::new(HashMap::new()), + vect: RefCell::new(~[]), } } |
