]> git.lizzy.rs Git - rust.git/commitdiff
[3f0fb4f7] improve comment on `to_location`
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 25 Jul 2018 13:18:37 +0000 (16:18 +0300)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 25 Jul 2018 13:18:37 +0000 (16:18 +0300)
src/librustc_mir/borrow_check/nll/region_infer/values.rs

index 2d7cbfce1a31bfdc370dc71d3893d1f605ebc1e5..2503c943b7f72120190762b54d53c044eb57695b 100644 (file)
@@ -47,6 +47,7 @@ impl RegionValueElements {
         }
     }
 
+    /// Converts a `Location` into a `PointIndex`. O(1).
     fn point_from_location(&self, location: Location) -> PointIndex {
         let Location {
             block,
@@ -56,8 +57,8 @@ fn point_from_location(&self, location: Location) -> PointIndex {
         PointIndex::new(start_index + statement_index)
     }
 
-    /// Converts a particular `RegionElementIndex` to a location, if
-    /// that is what it represents. Returns `None` otherwise.
+    /// Converts a `PointIndex` back to a location. O(N) where N is
+    /// the number of blocks; could be faster if we ever cared.
     crate fn to_location(&self, i: PointIndex) -> Location {
         let point_index = i.index();