Minor refactoring
This commit is contained in:
parent
c40042baf6
commit
a9ef9d2496
@ -464,11 +464,9 @@ fn read_rule(rule: &clingo::ast::Rule, context: &Context) -> Result<(), crate::E
|
|||||||
|
|
||||||
context.variable_declaration_stack.borrow_mut().pop();
|
context.variable_declaration_stack.borrow_mut().pop();
|
||||||
|
|
||||||
let mut free_variable_declarations = vec![];
|
let free_variable_declarations = std::mem::replace(
|
||||||
|
|
||||||
std::mem::swap(
|
|
||||||
&mut context.variable_declaration_stack.borrow_mut().free_variable_declarations,
|
&mut context.variable_declaration_stack.borrow_mut().free_variable_declarations,
|
||||||
&mut free_variable_declarations);
|
vec![]);
|
||||||
|
|
||||||
let definition = match definition_arguments.len()
|
let definition = match definition_arguments.len()
|
||||||
{
|
{
|
||||||
@ -492,11 +490,9 @@ fn read_rule(rule: &clingo::ast::Rule, context: &Context) -> Result<(), crate::E
|
|||||||
{
|
{
|
||||||
let mut arguments = translate_body(rule.body(), context)?;
|
let mut arguments = translate_body(rule.body(), context)?;
|
||||||
|
|
||||||
let mut free_variable_declarations = vec![];
|
let free_variable_declarations = std::mem::replace(
|
||||||
|
|
||||||
std::mem::swap(
|
|
||||||
&mut context.variable_declaration_stack.borrow_mut().free_variable_declarations,
|
&mut context.variable_declaration_stack.borrow_mut().free_variable_declarations,
|
||||||
&mut free_variable_declarations);
|
vec![]);
|
||||||
|
|
||||||
let formula = match arguments.len()
|
let formula = match arguments.len()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user