Skip to content

Conversation

@philnik777
Copy link
Contributor

This removes a bit of code duplication and might simplify future segmented iterator optimitations.

@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions h -- libcxx/include/__algorithm/copy_backward.h libcxx/include/__algorithm/for_each_segment.h libcxx/include/__algorithm/move_backward.h --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/libcxx/include/__algorithm/for_each_segment.h b/libcxx/include/__algorithm/for_each_segment.h
index de0ed243d..3445f34c2 100644
--- a/libcxx/include/__algorithm/for_each_segment.h
+++ b/libcxx/include/__algorithm/for_each_segment.h
@@ -54,7 +54,7 @@ __for_each_segment_backward(_SegmentedIterator __first, _SegmentedIterator __las
   using _Traits = __segmented_iterator_traits<_SegmentedIterator>;
 
   auto __sfirst = _Traits::__segment(__first);
-  auto __slast = _Traits::__segment(__last);
+  auto __slast  = _Traits::__segment(__last);
 
   // We are in a single segment, so we might not be at the beginning or end
   if (__sfirst == __slast) {

@philnik777 philnik777 force-pushed the introduce_for_each_segment_backward branch from ae7d2eb to 81c10c2 Compare October 28, 2025 13:38
@philnik777 philnik777 force-pushed the introduce_for_each_segment_backward branch from 81c10c2 to 6254e5f Compare October 28, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant