mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-22 00:51:33 +03:00
Merge pull request #1402 from AleoHQ/fix-duplicate-bug
[Fix] Fixes the random flying bug with duplicates
This commit is contained in:
commit
4fb0c73873
@ -66,6 +66,11 @@ impl Identifier {
|
||||
span,
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if the Identifier name matches the other name
|
||||
pub fn matches(&self, other: &Self) -> bool {
|
||||
self.name == other.name
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ast> From<InputIdentifier<'ast>> for Identifier {
|
||||
@ -90,7 +95,7 @@ impl fmt::Debug for Identifier {
|
||||
|
||||
impl PartialEq for Identifier {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.name == other.name
|
||||
self.name == other.name && self.span == other.span
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ impl<'a, F: PrimeField, G: GroupType<F>> ConstrainedProgram<'a, F, G> {
|
||||
match context.input.remove(0) {
|
||||
ConstrainedValue::CircuitExpression(_variable, members) => {
|
||||
// Modify the circuit variable in place
|
||||
let matched_variable = members.iter_mut().find(|member| &member.0 == name);
|
||||
let matched_variable = members.iter_mut().find(|member| member.0.matches(name));
|
||||
|
||||
match matched_variable {
|
||||
Some(member) => {
|
||||
|
Loading…
Reference in New Issue
Block a user