mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 18:52:58 +03:00
perf: reduce Expression size from 244B to 152B
Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
parent
39cd98d2c0
commit
c8299743b8
@ -54,7 +54,7 @@ impl<F: Field + PrimeField, G: GroupType<F>> ConstrainedProgram<F, G> {
|
||||
Expression::Address(address, span) => Ok(ConstrainedValue::Address(Address::constant(address, span)?)),
|
||||
Expression::Boolean(boolean, span) => Ok(ConstrainedValue::Boolean(new_bool_constant(boolean, span)?)),
|
||||
Expression::Field(field, span) => Ok(ConstrainedValue::Field(FieldType::constant(field, span)?)),
|
||||
Expression::Group(group_element) => Ok(ConstrainedValue::Group(G::constant(group_element)?)),
|
||||
Expression::Group(group_element) => Ok(ConstrainedValue::Group(G::constant(*group_element)?)),
|
||||
Expression::Implicit(value, span) => Ok(enforce_number_implicit(expected_type, value, span)?),
|
||||
Expression::Integer(type_, integer, span) => {
|
||||
Ok(ConstrainedValue::Integer(Integer::new_constant(&type_, integer, span)?))
|
||||
|
@ -64,7 +64,7 @@ pub enum Expression {
|
||||
Address(String, Span),
|
||||
Boolean(String, Span),
|
||||
Field(String, Span),
|
||||
Group(GroupValue),
|
||||
Group(Box<GroupValue>),
|
||||
Implicit(String, Span),
|
||||
Integer(IntegerType, String, Span),
|
||||
|
||||
@ -597,7 +597,7 @@ impl<'ast> From<FieldValue<'ast>> for Expression {
|
||||
|
||||
impl<'ast> From<AstGroupValue<'ast>> for Expression {
|
||||
fn from(ast_group: AstGroupValue<'ast>) -> Self {
|
||||
Expression::Group(GroupValue::from(ast_group))
|
||||
Expression::Group(Box::new(GroupValue::from(ast_group)))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user