make retract_local_clauses safe, remove warning about overwriting warning in do_not_duplicate_path_components test

This commit is contained in:
Mark Thom
2021-03-23 12:37:43 -06:00
parent 7520fe7000
commit 290cb1b517
2 changed files with 10 additions and 9 deletions

View File

@@ -344,7 +344,7 @@ impl<'a> LoadState<'a> {
key: PredicateKey, key: PredicateKey,
clause_locs: &SliceDeque<usize>, clause_locs: &SliceDeque<usize>,
) { ) {
let (clause_target_poses, is_dynamic) = self let result_opt = self
.wam .wam
.indices .indices
.get_predicate_skeleton(&compilation_target, &key) .get_predicate_skeleton(&compilation_target, &key)
@@ -358,14 +358,16 @@ impl<'a> LoadState<'a> {
}) })
.collect(), .collect(),
skeleton.is_dynamic) skeleton.is_dynamic)
}).unwrap(); });
self.retract_local_clauses_by_locs( if let Some((clause_target_poses, is_dynamic)) = result_opt {
compilation_target, self.retract_local_clauses_by_locs(
key, compilation_target,
clause_target_poses, key,
is_dynamic, clause_target_poses,
); is_dynamic,
);
}
} }
pub(super) fn retract_local_clauses_by_locs( pub(super) fn retract_local_clauses_by_locs(

View File

@@ -29,7 +29,6 @@ fn do_not_duplicate_path_components() {
"\ "\
caught: e\n\ caught: e\n\
false.\n\ false.\n\
Warning: overwriting $initialization_goals/1\n\
caught: e\n\ caught: e\n\
false.\n\ false.\n\
", ",