Skip to content

Commit 52c94e9

Browse files
committed
remove inefficiency for adding all points
1 parent 7c74518 commit 52c94e9

File tree

1 file changed

+1
-10
lines changed
  • src/librustc_mir/borrow_check/nll/region_infer

1 file changed

+1
-10
lines changed

src/librustc_mir/borrow_check/nll/region_infer/values.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_data_structures::indexed_vec::Idx;
1515
use rustc_data_structures::indexed_vec::IndexVec;
1616
use std::fmt::Debug;
1717
use std::rc::Rc;
18-
use std::ops::Range;
1918

2019
/// Maps between the various kinds of elements of a region value to
2120
/// the internal indices that w use.
@@ -65,11 +64,6 @@ impl RegionValueElements {
6564
PointIndex::new(start_index + statement_index)
6665
}
6766

68-
/// Range coverting all point indices.
69-
fn all_points(&self) -> Range<PointIndex> {
70-
PointIndex::new(0)..PointIndex::new(self.num_points)
71-
}
72-
7367
/// Converts a particular `RegionElementIndex` to a location, if
7468
/// that is what it represents. Returns `None` otherwise.
7569
crate fn to_location(&self, i: PointIndex) -> Location {
@@ -159,10 +153,7 @@ impl<N: Idx> RegionValues<N> {
159153

160154
/// Adds all the control-flow points to the values for `r`.
161155
crate fn add_all_points(&mut self, r: N) {
162-
// FIXME OMG so inefficient. We'll fix later.
163-
for p in self.elements.all_points() {
164-
self.points.add(r, p);
165-
}
156+
self.points.add_all(r);
166157
}
167158

168159
/// Add all elements in `r_from` to `r_to` (because e.g. `r_to:

0 commit comments

Comments
 (0)