File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
branches/dist-snap/src/libcore Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: 10e317de547851bdf714ada4d21b41f5b989d4ed
10
+ refs/heads/dist-snap: 1834249e8dff3419f33ee8595a4bf347e50c3c62
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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