Skip to content

Commit a5c653b

Browse files
committed
Simplify TypeVariableTable::vars_since_snapshot
1 parent 2a08860 commit a5c653b

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/librustc/infer/type_variable.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,10 @@ impl<'tcx> TypeVariableTable<'tcx> {
295295
/// Returns a map from the type variables created during the
296296
/// snapshot to the origin of the type variable.
297297
pub fn vars_since_snapshot(&mut self, s: &Snapshot<'tcx>) -> TypeVariableMap {
298-
let actions_since_snapshot = self.values.actions_since_snapshot(&s.snapshot);
299-
300-
actions_since_snapshot
301-
.iter()
302-
.filter_map(|action| match action {
303-
&sv::UndoLog::NewElem(index) => Some(ty::TyVid { index: index as u32 }),
304-
_ => None,
305-
})
306-
.map(|vid| {
307-
let origin = self.values.get(vid.index as usize).origin.clone();
308-
(vid, origin)
309-
})
310-
.collect()
298+
self.values.values_since_snapshot(&s.snapshot).map(|idx| {
299+
let origin = self.values.get(idx).origin.clone();
300+
(ty::TyVid { index: idx as u32 }, origin)
301+
}).collect()
311302
}
312303

313304
/// Finds the set of type variables that existed *before* `s`

0 commit comments

Comments
 (0)