Skip to content

Commit 76fc192

Browse files
committed
Remove redundant tests in segmented_copy_if_dst_dispatch
1 parent 2b0a094 commit 76fc192

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

include/boost/container/experimental/segmented_copy_if.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,20 @@ SegDstIter segmented_copy_if_dst_dispatch
167167
dst_segment_iterator dst_seg = dst_traits::segment(result);
168168
dst_local_iterator dst_local = dst_traits::local(result);
169169

170-
while(first != last) {
171-
const dst_local_iterator dst_end = dst_traits::end(dst_seg);
170+
while (1) {
172171
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_if_dst_bounded)
173-
(first, last, dst_local, dst_end, pred, dst_is_local_seg_t(), Cat());
172+
(first, last, dst_local, dst_traits::end(dst_seg), pred, dst_is_local_seg_t(), Cat());
174173
first = r.first;
175174
if(first != last) {
176175
++dst_seg;
177176
dst_local = dst_traits::begin(dst_seg);
178177
}
179-
else
178+
else {
180179
dst_local = r.second;
180+
break;
181+
}
181182
}
183+
182184
return dst_traits::compose(dst_seg, dst_local);
183185
}
184186

0 commit comments

Comments
 (0)