Remove scope.get

This commit is contained in:
Ayaz Hafiz 2023-06-09 15:42:45 -05:00
parent bbef63f28f
commit 4d65db22d2
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 6 additions and 13 deletions

View file

@ -2736,12 +2736,9 @@ fn load_symbol_and_lambda_set<'a, 'ctx>(
scope: &Scope<'a, 'ctx>,
symbol: &Symbol,
) -> (BasicValueEnum<'ctx>, LambdaSet<'a>) {
match scope
.get(symbol)
.map(|(l, v)| (layout_interner.get_repr(*l), v))
{
Some((LayoutRepr::LambdaSet(lambda_set), ptr)) => (*ptr, lambda_set),
Some((other, ptr)) => panic!("Not a lambda set: {:?}, {:?}", other, ptr),
None => panic!("There was no entry for {:?} in scope {:?}", symbol, scope),
let (ptr, layout) = scope.load_symbol_and_layout(symbol);
match layout_interner.get_repr(layout) {
LayoutRepr::LambdaSet(lambda_set) => (ptr, lambda_set),
other => panic!("Not a lambda set: {:?}, {:?}", other, ptr),
}
}