1
Fork 0

Rollup merge of #111899 - nnethercote:cgu-cleanups, r=wesleywiser

CGU cleanups

Some code clarity improvements I found when reading this code closely.

r? ``@wesleywiser``
This commit is contained in:
Matthias Krüger 2023-05-26 08:24:07 +02:00 committed by GitHub
commit 78cc117f7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 169 additions and 206 deletions

View file

@ -334,10 +334,7 @@ impl<'tcx> CodegenUnit<'tcx> {
}
pub fn modify_size_estimate(&mut self, delta: usize) {
assert!(self.size_estimate.is_some());
if let Some(size_estimate) = self.size_estimate {
self.size_estimate = Some(size_estimate + delta);
}
*self.size_estimate.as_mut().unwrap() += delta;
}
pub fn contains_item(&self, item: &MonoItem<'tcx>) -> bool {