Auto merge of #93643 - lcnr:fold-substs-perf, r=michaelwoerister
use `fold_list` in `try_super_fold_with` for `SubstsRef` split out from #93505 as this by itself is responsible for most of the perf improvements there r? `@michaelwoerister`
This commit is contained in:
commit
926e7843ea
1 changed files with 1 additions and 9 deletions
|
@ -396,15 +396,7 @@ impl<'tcx> TypeFoldable<'tcx> for SubstsRef<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
0 => Ok(self),
|
0 => Ok(self),
|
||||||
_ => {
|
_ => ty::util::fold_list(self, folder, |tcx, v| tcx.intern_substs(v)),
|
||||||
let params: SmallVec<[_; 8]> =
|
|
||||||
self.iter().map(|k| k.try_fold_with(folder)).collect::<Result<_, _>>()?;
|
|
||||||
if params[..] == self[..] {
|
|
||||||
Ok(self)
|
|
||||||
} else {
|
|
||||||
Ok(folder.tcx().intern_substs(¶ms))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue