const auto src_sub_slice = BeesExtentSlice(src_tree, cursor, dst_ref.end());
src_sub_slice.refs(ctx.layer().get(), [&](BeesExtentLayer *, const BeesTreeRefSlice &src_ref) {
const auto src_fd = src_ref.ref().open(ctx);
- if (!!src_fd) {
- const auto overlap_end = min(src_ref.end(), dst_ref.end());
- const auto src_file_begin = src_ref.file_begin() + cursor - src_ref.begin();
- const auto src_file_end = src_file_begin + overlap_end - cursor;
- const auto dst_file_begin = dst_ref.file_begin() + cursor - dst_ref.begin();
- const auto dst_file_end = dst_file_begin + overlap_end - cursor;
-
- if (const auto pair = scan_next_make_clipped_file_pair(
- src_fd, src_file_begin, src_file_end,
- dst_fd, dst_file_begin, dst_file_end)) {
- append_pair(*pair);
- }
-
- best_overlap_end = max(best_overlap_end, overlap_end);
- covered = true;
- return false; // Stop walking once covered
+ if (!src_fd) {
+ return true; // Keep walking to try other overlapping fallbacks
}
- return true; // Keep walking to try other overlapping fallbacks
+ const auto overlap_end = min(src_ref.end(), dst_ref.end());
+ const auto src_file_begin = src_ref.file_begin() + cursor - src_ref.begin();
+ const auto src_file_end = src_file_begin + overlap_end - cursor;
+ const auto dst_file_begin = dst_ref.file_begin() + cursor - dst_ref.begin();
+ const auto dst_file_end = dst_file_begin + overlap_end - cursor;
+
+ if (const auto pair = scan_next_make_clipped_file_pair(
+ src_fd, src_file_begin, src_file_end,
+ dst_fd, dst_file_begin, dst_file_end)) {
+ append_pair(*pair);
+ }
+
+ best_overlap_end = max(best_overlap_end, overlap_end);
+ covered = true;
+ return false; // Stop walking once covered
}, BeesVisitorPath::src);
if (!covered) {