File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5
- refs/heads/try: 10e317de547851bdf714ada4d21b41f5b989d4ed
5
+ refs/heads/try: 1834249e8dff3419f33ee8595a4bf347e50c3c62
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ trait SendMap<K:Eq Hash, V: Copy> {
22
22
fn each_value_ref ( & self , blk : fn ( v : & V ) -> bool ) ;
23
23
fn find ( & const self , k : & K ) -> Option < V > ;
24
24
fn get ( & const self , k : & K ) -> V ;
25
- fn with_find_ref < T > ( & const self , k : & K , blk : fn ( Option < & V > ) -> T ) -> T ;
26
- fn with_get_ref < T > ( & const self , k : & K , blk : fn ( v : & V ) -> T ) -> T ;
25
+ fn find_ref ( & self , k : & K ) -> Option < & self / V > ;
26
+ fn get_ref ( & self , k : & K ) -> & self / V ;
27
27
}
28
28
29
29
/// Open addressing with linear probing.
@@ -304,6 +304,13 @@ mod linear {
304
304
}
305
305
}
306
306
307
+ fn get_ref ( & self , k : & K ) -> & self /V {
308
+ match self . find_ref ( k) {
309
+ Some ( v) => v,
310
+ None => fail fmt ! ( "No entry found for key: %?" , k) ,
311
+ }
312
+ }
313
+
307
314
fn each_ref ( & self , blk : fn ( k : & K , v : & V ) -> bool ) {
308
315
for vec:: each( self . buckets) |slot| {
309
316
let mut broke = false ;
You can’t perform that action at this time.
0 commit comments