mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
cleanup
This commit is contained in:
parent
138af15da5
commit
b9a3fd7f8a
1 changed files with 1 additions and 26 deletions
|
@ -74,12 +74,6 @@ pub fn infer_borrow<'a>(
|
|||
env.param_map
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
|
||||
pub enum Key {
|
||||
Declaration(DeclarationId),
|
||||
JoinPoint(JoinPointId),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
|
||||
pub struct DeclarationId(usize);
|
||||
|
||||
|
@ -92,30 +86,11 @@ impl From<DeclarationId> for usize {
|
|||
#[derive(Debug, Clone)]
|
||||
pub struct ParamMap<'a> {
|
||||
declaration_to_index: MutMap<(Symbol, ProcLayout<'a>), DeclarationId>,
|
||||
// IDEA: flatten the declarations into just one flat array
|
||||
declarations: Vec<'a, &'a [Param<'a>]>,
|
||||
join_points: MutMap<JoinPointId, &'a [Param<'a>]>,
|
||||
}
|
||||
|
||||
/*
|
||||
impl<'a> IntoIterator for ParamMap<'a> {
|
||||
type Item = (Key, &'a [Param<'a>]);
|
||||
type IntoIter = <std::collections::HashMap<Key, &'a [Param<'a>]> as IntoIterator>::IntoIter;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.items.into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a ParamMap<'a> {
|
||||
type Item = (&'a Key, &'a &'a [Param<'a>]);
|
||||
type IntoIter = <&'a std::collections::HashMap<Key, &'a [Param<'a>]> as IntoIterator>::IntoIter;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.items.iter()
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
impl<'a> ParamMap<'a> {
|
||||
pub fn get_symbol(&self, symbol: Symbol, layout: ProcLayout<'a>) -> Option<&'a [Param<'a>]> {
|
||||
let index: usize = self.declaration_to_index[&(symbol, layout)].into();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue