Skip to content

Commit 951ad11

Browse files
committed
auto merge of #4815 : thestinger/rust/treemap, r=pcwalton
5283a8b reworks the TreeMap lazy iterator to use `&mut` again, which closes #4763. It gets the performance of the set methods back in the same ballpark that it was pre-INHTWAMA which is nice. These can be turned back into methods eventually. e5b6334 removes the transitional smallintmap attributes which closes #4737.
2 parents 8280c81 + dab2f2f commit 951ad11

File tree

4 files changed

+72
-90
lines changed

4 files changed

+72
-90
lines changed

src/libcore/hashmap.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ pub mod linear {
4949
buckets: ~[Option<Bucket<K, V>>],
5050
}
5151

52-
// FIXME(#3148) -- we could rewrite FoundEntry
53-
// to have type Option<&Bucket<K, V>> which would be nifty
54-
// However, that won't work until #3148 is fixed
52+
// We could rewrite FoundEntry to have type Option<&Bucket<K, V>>
53+
// which would be nifty
5554
enum SearchResult {
5655
FoundEntry(uint), FoundHole(uint), TableFull
5756
}
@@ -296,8 +295,6 @@ pub mod linear {
296295
FoundEntry(idx) => {
297296
match self.buckets[idx] {
298297
Some(ref bkt) => {
299-
// FIXME(#3148)---should be inferred
300-
let bkt: &self/Bucket<K, V> = bkt;
301298
Some(&bkt.value)
302299
}
303300
None => {

src/libstd/json.rs

-8
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,6 @@ pub impl Decoder: serialize::Decoder {
856856
debug!("read_vec_elt(idx=%u)", idx);
857857
match *self.peek() {
858858
List(ref list) => {
859-
// FIXME(#3148)---should be inferred
860-
let list: &self/~[Json] = list;
861-
862859
self.stack.push(&list[idx]);
863860
f()
864861
}
@@ -885,9 +882,6 @@ pub impl Decoder: serialize::Decoder {
885882
let top = self.peek();
886883
match *top {
887884
Object(ref obj) => {
888-
// FIXME(#3148) This hint should not be necessary.
889-
let obj: &self/~Object = obj;
890-
891885
match obj.find(&name.to_owned()) {
892886
None => die!(fmt!("no such field: %s", name)),
893887
Some(json) => {
@@ -917,8 +911,6 @@ pub impl Decoder: serialize::Decoder {
917911
debug!("read_tup_elt(idx=%u)", idx);
918912
match *self.peek() {
919913
List(ref list) => {
920-
// FIXME(#3148)---should be inferred
921-
let list: &self/~[Json] = list;
922914
self.stack.push(&list[idx]);
923915
f()
924916
}

src/libstd/smallintmap.rs

-4
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ pub impl<V> SmallIntMap<V> {
116116
}
117117

118118
pub impl<V: Copy> SmallIntMap<V> {
119-
// FIXME: #4733, remove after the next snapshot
120-
#[cfg(stage2)]
121119
fn update_with_key(&mut self, key: uint, val: V,
122120
ff: fn(uint, V, V) -> V) -> bool {
123121
match self.find(&key) {
@@ -126,8 +124,6 @@ pub impl<V: Copy> SmallIntMap<V> {
126124
}
127125
}
128126

129-
// FIXME: #4733, remove after the next snapshot
130-
#[cfg(stage2)]
131127
fn update(&mut self, key: uint, newval: V, ff: fn(V, V) -> V) -> bool {
132128
self.update_with_key(key, newval, |_k, v, v1| ff(v,v1))
133129
}

0 commit comments

Comments
 (0)