Skip to content

Commit

Permalink
Remove unnecessary clones
Browse files Browse the repository at this point in the history
  • Loading branch information
teiesti authored and ZachJHansen committed Dec 12, 2023
1 parent caadf2d commit ddef245
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions src/translating/tau_star.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ fn construct_interval_formula(
fol::Formula::QuantifiedFormula {
quantification: fol::Quantification {
quantifier: fol::Quantifier::Exists,
variables: vec![i_var.clone(), j_var.clone(), k_var.clone()],
variables: vec![i_var, j_var, k_var],
},
formula: fol::Formula::BinaryFormula {
connective: fol::BinaryConnective::Conjunction,
Expand Down Expand Up @@ -484,8 +484,8 @@ fn val(t: asp::Term, z: fol::Variable) -> fol::Formula {
valti,
valtj,
asp::BinaryOperator::Subtract,
var1.clone(),
var2.clone(),
var1,
var2,
z,
)
}
Expand All @@ -499,50 +499,45 @@ fn val(t: asp::Term, z: fol::Variable) -> fol::Formula {
valti,
valtj,
asp::BinaryOperator::Add,
var1.clone(),
var2.clone(),
var1,
var2,
z,
),
asp::BinaryOperator::Subtract => construct_total_function_formula(
valti,
valtj,
asp::BinaryOperator::Subtract,
var1.clone(),
var2.clone(),
var1,
var2,
z,
),
asp::BinaryOperator::Multiply => construct_total_function_formula(
valti,
valtj,
asp::BinaryOperator::Multiply,
var1.clone(),
var2.clone(),
var1,
var2,
z,
),
asp::BinaryOperator::Divide => construct_partial_function_formula(
valti,
valtj,
asp::BinaryOperator::Divide,
var1.clone(),
var2.clone(),
var1,
var2,
z,
),
asp::BinaryOperator::Modulo => construct_partial_function_formula(
valti,
valtj,
asp::BinaryOperator::Modulo,
var1.clone(),
var2.clone(),
z,
),
asp::BinaryOperator::Interval => construct_interval_formula(
valti,
valtj,
var1.clone(),
var2.clone(),
var3.clone(),
var1,
var2,
z,
),
asp::BinaryOperator::Interval => {
construct_interval_formula(valti, valtj, var1, var2, var3, z)
}
}
}
}
Expand Down

0 comments on commit ddef245

Please sign in to comment.