fix clone on copy values

This commit is contained in:
Bennet Bleßmann
2025-07-31 21:28:30 +02:00
parent 8cc74b2af7
commit 72631b3e0b
3 changed files with 8 additions and 8 deletions

View File

@@ -1055,7 +1055,7 @@ fn generate_instruction_preface() -> TokenStream {
constants.iter().map(|(c, ptr)| {
functor!(
atom!(":"),
[cell((c.clone())), indexing_code_ptr((*ptr))]
[cell((*c)), indexing_code_ptr((*ptr))]
)
}),
)

View File

@@ -698,9 +698,9 @@ mod tests {
let functor = variadic_functor(
atom!("switch_on_constants"),
1,
constants.iter().map(|(c, ptr)| {
functor!(atom!(":"), [cell((c.clone())), indexing_code_ptr((*ptr))])
}),
constants
.iter()
.map(|(c, ptr)| functor!(atom!(":"), [cell((*c)), indexing_code_ptr((*ptr))])),
);
heap.truncate(0);

View File

@@ -133,7 +133,7 @@ fn merge_indices(
);
retraction_info.push_record(RetractionRecord::AddedIndex(
skeleton[clause_index].opt_arg_index_key.clone(),
skeleton[clause_index].opt_arg_index_key,
clause_loc,
));
} else {
@@ -246,7 +246,7 @@ fn remove_index_from_subsequence(
// appear anywhere inside an Internal record.
retraction_info.push_record(RetractionRecord::RemovedIndex(
index_loc,
opt_arg_index_key.clone(),
*opt_arg_index_key,
offset,
));
}
@@ -808,7 +808,7 @@ fn prepend_compiled_clause(
skeleton.clauses[0].clause_start = clause_loc + 2;
retraction_info.push_record(RetractionRecord::AddedIndex(
skeleton.clauses[0].opt_arg_index_key.clone(),
skeleton.clauses[0].opt_arg_index_key,
skeleton.clauses[0].clause_start,
));
@@ -1070,7 +1070,7 @@ fn append_compiled_clause(
skeleton.clauses[target_pos].opt_arg_index_key += index_loc - 1;
retraction_info.push_record(RetractionRecord::AddedIndex(
skeleton.clauses[target_pos].opt_arg_index_key.clone(),
skeleton.clauses[target_pos].opt_arg_index_key,
skeleton.clauses[target_pos].clause_start,
));