Always start off with an empty cache

Adding a cache layer can only be done with a snapshot and rollback.
This is necessary to prevent extra variables just lying around on the
toplevel of the layout cache.
This commit is contained in:
Ayaz Hafiz 2023-01-30 13:08:21 -06:00
parent 1e22a2bbcd
commit a16ea95a04
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 6 additions and 4 deletions

View file

@ -120,10 +120,8 @@ pub struct LayoutCache<'a> {
impl<'a> LayoutCache<'a> {
pub fn new(interner: TLLayoutInterner<'a>, target_info: TargetInfo) -> Self {
let mut cache = std::vec::Vec::with_capacity(4);
cache.push(CacheLayer::default());
let mut raw_cache = std::vec::Vec::with_capacity(4);
raw_cache.push(CacheLayer::default());
let cache = std::vec::Vec::with_capacity(4);
let raw_cache = std::vec::Vec::with_capacity(4);
Self {
target_info,
cache,