Prime the cache with a default layer

This commit is contained in:
Ayaz Hafiz 2023-01-30 16:48:01 -06:00
parent c3064dad73
commit 8c68044c54
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

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