diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-07-29 16:00:55 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-07-29 18:39:15 -0700 |
| commit | 082d8314da6b6b99854f0a70f5ea8e27f2602f79 (patch) | |
| tree | ddf17676e2fadd5918bbed301128ff03d2542c31 /src/libsyntax/ext | |
| parent | 6ac86e92fe2512b61881a8d716b4faf5a9feaba6 (diff) | |
| download | rust-082d8314da6b6b99854f0a70f5ea8e27f2602f79.tar.gz rust-082d8314da6b6b99854f0a70f5ea8e27f2602f79.zip | |
Rewrite bitv to use classes and optimize its representation
Rewrote bitv as a class that uses a 32-bit int as its representation for bit vectors of 32 bits or less, and a vector (the old representation) otherwise. I didn't benchmark very much, but a bit of informal benchmarking suggested this is a win. Closes #2341
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes/liveness.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index d8467e36c84..c3ae0fb80fd 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -29,7 +29,7 @@ updating the states using rule (2) until there are no changes. import dvec::extensions; -import std::bitv::{bitv, methods}; +import std::bitv::{bitv}; import proto::methods; import ast_builder::empty_span; @@ -38,7 +38,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) { #debug("initializing colive analysis"); let num_states = proto.num_states(); let colive = do (copy proto.states).map_to_vec |state| { - let bv = bitv(num_states, false); + let bv = ~bitv(num_states, false); for state.reachable |s| { bv.set(s.id, true); } |
