Skip to content

Commit 0399532

Browse files
committed
---
yaml --- r: 233583 b: refs/heads/beta c: dcf6f08 h: refs/heads/master i: 233581: cc4214e 233579: 894e5b5 233575: 656a9ce 233567: b9082b3 v: v3
1 parent bbb7fbc commit 0399532

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 4b1d3b703629db036ce685a852b80bf196419bb5
26+
refs/heads/beta: dcf6f08138e7831d75b39e4c11c0a5acc2cd3831
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc/util/common.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -203,49 +203,6 @@ pub fn block_query<P>(b: &ast::Block, p: P) -> bool where P: FnMut(&ast::Expr) -
203203
return v.flag;
204204
}
205205

206-
/// K: Eq + Hash<S>, V, S, H: Hasher<S>
207-
///
208-
/// Determines whether there exists a path from `source` to `destination`. The
209-
/// graph is defined by the `edges_map`, which maps from a node `S` to a list of
210-
/// its adjacent nodes `T`.
211-
///
212-
/// Efficiency note: This is implemented in an inefficient way because it is
213-
/// typically invoked on very small graphs. If the graphs become larger, a more
214-
/// efficient graph representation and algorithm would probably be advised.
215-
pub fn can_reach<T, S>(edges_map: &HashMap<T, Vec<T>, S>, source: T,
216-
destination: T) -> bool
217-
where S: HashState, T: Hash + Eq + Clone,
218-
{
219-
if source == destination {
220-
return true;
221-
}
222-
223-
// Do a little breadth-first-search here. The `queue` list
224-
// doubles as a way to detect if we've seen a particular FR
225-
// before. Note that we expect this graph to be an *extremely
226-
// shallow* tree.
227-
let mut queue = vec!(source);
228-
let mut i = 0;
229-
while i < queue.len() {
230-
match edges_map.get(&queue[i]) {
231-
Some(edges) => {
232-
for target in edges {
233-
if *target == destination {
234-
return true;
235-
}
236-
237-
if !queue.iter().any(|x| x == target) {
238-
queue.push((*target).clone());
239-
}
240-
}
241-
}
242-
None => {}
243-
}
244-
i += 1;
245-
}
246-
return false;
247-
}
248-
249206
/// Memoizes a one-argument closure using the given RefCell containing
250207
/// a type implementing MutableMap to serve as a cache.
251208
///

0 commit comments

Comments
 (0)