Skip to content

Commit

Permalink
Remove needless dedup from projection
Browse files Browse the repository at this point in the history
  • Loading branch information
ishitatsuyuki committed Feb 22, 2018
1 parent 0e26bb7 commit 93e6b0d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/librustc/traits/project.rs
Expand Up @@ -835,16 +835,6 @@ fn project_type<'cx, 'gcx, 'tcx>(
return Err(ProjectionTyError::TooManyCandidates);
}

// Drop duplicates.
//
// Note: `candidates.vec` seems to be on the critical path of the
// compiler. Replacing it with an HashSet was also tried, which would
// render the following dedup unnecessary. The original comment indicated
// that it was 9% slower, but that data is now obsolete and a new
// benchmark should be performed.
candidates.vec.sort_unstable();
candidates.vec.dedup();

// Prefer where-clauses. As in select, if there are multiple
// candidates, we prefer where-clause candidates over impls. This
// may seem a bit surprising, since impls are the source of
Expand Down

0 comments on commit 93e6b0d

Please sign in to comment.