mirror of
https://github.com/RustPython/Parser.git
synced 2025-09-12 05:16:16 +00:00
Impl Eq+Hash for ConstantData, make CodeInfo.constants an IndexSet
This commit is contained in:
parent
89c08246ba
commit
da0c85d2ac
2 changed files with 5 additions and 6 deletions
|
@ -37,7 +37,7 @@ pub struct CodeInfo {
|
|||
|
||||
pub blocks: Vec<Block>,
|
||||
pub current_block: BlockIdx,
|
||||
pub constants: Vec<ConstantData>,
|
||||
pub constants: IndexSet<ConstantData>,
|
||||
pub name_cache: IndexSet<String>,
|
||||
pub varname_cache: IndexSet<String>,
|
||||
pub cellvar_cache: IndexSet<String>,
|
||||
|
@ -104,7 +104,7 @@ impl CodeInfo {
|
|||
max_stacksize,
|
||||
instructions: instructions.into_boxed_slice(),
|
||||
locations: locations.into_boxed_slice(),
|
||||
constants: constants.into(),
|
||||
constants: constants.into_iter().collect(),
|
||||
names: name_cache.into_iter().collect(),
|
||||
varnames: varname_cache.into_iter().collect(),
|
||||
cellvars: cellvar_cache.into_iter().collect(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue