mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
add tag name dedup
This commit is contained in:
parent
3139e73cf9
commit
093b733a2c
2 changed files with 101 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::types::{name_type_var, ErrorType, Problem, RecordField, TypeExt};
|
||||
use roc_collections::all::{ImMap, ImSet, MutSet, SendMap};
|
||||
use roc_collections::all::{ImMap, ImSet, MutMap, MutSet, SendMap};
|
||||
use roc_module::ident::{Lowercase, TagName, Uppercase};
|
||||
use roc_module::symbol::Symbol;
|
||||
use std::fmt;
|
||||
|
@ -59,6 +59,7 @@ pub struct Subs {
|
|||
pub field_names: Vec<Lowercase>,
|
||||
pub record_fields: Vec<RecordField<()>>,
|
||||
pub variable_slices: Vec<VariableSubsSlice>,
|
||||
pub tag_name_cache: MutMap<TagName, SubsSlice<TagName>>,
|
||||
}
|
||||
|
||||
impl Default for Subs {
|
||||
|
@ -1027,6 +1028,7 @@ impl Subs {
|
|||
// store an empty slice at the first position
|
||||
// used for "TagOrFunction"
|
||||
variable_slices: vec![VariableSubsSlice::default()],
|
||||
tag_name_cache: MutMap::default(),
|
||||
};
|
||||
|
||||
// NOTE the utable does not (currently) have a with_capacity; using this as the next-best thing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue