|
|
@ -1056,7 +1056,7 @@ fn put_value(position: usize, value: EncodedTerm, tuple: &mut EncodedTuple) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn bind_variables_in_set(binding: &[Option<EncodedTerm>], set: &[usize]) -> Vec<usize> { |
|
|
|
fn bind_variables_in_set(binding: &[Option<EncodedTerm>], set: &[usize]) -> Vec<usize> { |
|
|
|
set.into_iter() |
|
|
|
set.iter() |
|
|
|
.cloned() |
|
|
|
.cloned() |
|
|
|
.filter(|key| *key < binding.len() && binding[*key].is_some()) |
|
|
|
.filter(|key| *key < binding.len() && binding[*key].is_some()) |
|
|
|
.collect() |
|
|
|
.collect() |
|
|
@ -1073,7 +1073,7 @@ fn unbind_variables(binding: &mut [Option<EncodedTerm>], variables: &[usize]) { |
|
|
|
fn combine_tuples(a: &[Option<EncodedTerm>], b: &[Option<EncodedTerm>]) -> Option<EncodedTuple> { |
|
|
|
fn combine_tuples(a: &[Option<EncodedTerm>], b: &[Option<EncodedTerm>]) -> Option<EncodedTuple> { |
|
|
|
if a.len() < b.len() { |
|
|
|
if a.len() < b.len() { |
|
|
|
let mut result = b.to_owned(); |
|
|
|
let mut result = b.to_owned(); |
|
|
|
for (key, a_value) in a.into_iter().enumerate() { |
|
|
|
for (key, a_value) in a.iter().enumerate() { |
|
|
|
if let Some(a_value) = a_value { |
|
|
|
if let Some(a_value) = a_value { |
|
|
|
match b[key] { |
|
|
|
match b[key] { |
|
|
|
Some(ref b_value) => { |
|
|
|
Some(ref b_value) => { |
|
|
@ -1088,7 +1088,7 @@ fn combine_tuples(a: &[Option<EncodedTerm>], b: &[Option<EncodedTerm>]) -> Optio |
|
|
|
Some(result) |
|
|
|
Some(result) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let mut result = a.to_owned(); |
|
|
|
let mut result = a.to_owned(); |
|
|
|
for (key, b_value) in b.into_iter().enumerate() { |
|
|
|
for (key, b_value) in b.iter().enumerate() { |
|
|
|
if let Some(b_value) = b_value { |
|
|
|
if let Some(b_value) = b_value { |
|
|
|
match a[key] { |
|
|
|
match a[key] { |
|
|
|
Some(ref a_value) => { |
|
|
|
Some(ref a_value) => { |
|
|
|