Use BOOST_[UN]LIKELY instead of own macro

This commit is contained in:
Ion Gaztañaga
2026-07-31 12:16:18 +02:00
parent 6a1a7d66cf
commit 2d8d74e714
35 changed files with 132 additions and 143 deletions
@@ -49,7 +49,7 @@ segmented_copy_dst_bounded
{
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
for(; first != last; ++first) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
break;
*dst_first = *first;
++dst_first;
@@ -96,7 +96,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_dst_bounded)
(first, last, db, de, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -104,7 +104,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_dst_bounded)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), dst_is_local_seg_t(), SrcCat());
first = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -192,7 +192,7 @@ OutIter segmented_copy_dispatch(SegIter first, SegIter last, OutIter result, seg
const src_local_iterator le = last_seg ? src_traits::local(last) : src_traits::end(sfirst);
result = (segmented_copy_dispatch)
(lb, le, result, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -57,7 +57,7 @@ segmented_copy_if_dst_bounded
//past the element that was written, so the next call resumes on an untested
//element. With an unreachable_sentinel_t destination both checks fold away,
//so the flat path is unchanged.
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
return segduo<SrcIter, DstIter>(first, dst_first);
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
@@ -65,7 +65,7 @@ segmented_copy_if_dst_bounded
if(pred(*first)) {
*dst_first = *first;
++dst_first;
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
++first;
goto out_path;
}
@@ -139,7 +139,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_if_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_if_dst_bounded)
(first, last, db, de, pred, dst_is_local_seg_t(), SrcCat());
first = r.first;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if (last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(dsfirst, r.second));
}
@@ -147,7 +147,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_if_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_if_dst_bounded)
(first, last, dst_traits::begin(dsfirst), dst_traits::end(dsfirst), pred, dst_is_local_seg_t(), SrcCat());
first = r.first;
if (BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if (BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(dsfirst, r.second));
}
@@ -190,7 +190,7 @@ SegDstIter segmented_copy_if_dst_dispatch
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_if_dst_bounded)
(first, last, dst_local, dst_traits::end(dst_seg), pred, dst_is_local_seg_t(), Cat());
first = r.first;
if(BOOST_CONTAINER_SEG_LIKELY(first != last)) {
if(BOOST_LIKELY(first != last)) {
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
}
@@ -235,7 +235,7 @@ OutIter segmented_copy_if_dispatch
const src_local_iterator le = last_seg ? src_traits::local(last) : src_traits::end(sfirst);
result = (segmented_copy_if_dispatch)
(lb, le, result, pred, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -51,7 +51,7 @@ segmented_copy_n_src_dst_bounded
{
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
for(; count > 0; ++first, --count) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last || first == last))
if(BOOST_UNLIKELY(dst_first == dst_last || first == last))
goto out_path;
*dst_first = *first;
++dst_first;
@@ -113,7 +113,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_n_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_n_dst_bounded)
(first, last, count, db, de, dst_is_local_seg_t());
first = r.first;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(count == 0 || first == last))
if (last_seg || BOOST_UNLIKELY(count == 0 || first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sdfirst, r.second));
}
@@ -121,7 +121,7 @@ segduo<SrcIter, SegDstIter> segmented_copy_n_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_copy_n_dst_bounded)
(first, last, count, dst_traits::begin(sdfirst), dst_traits::end(sdfirst), dst_is_local_seg_t());
first = r.first;
if (BOOST_CONTAINER_SEG_UNLIKELY(count == 0 || first == last))
if (BOOST_UNLIKELY(count == 0 || first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sdfirst, r.second));
}
@@ -166,7 +166,7 @@ SegDstIter segmented_copy_n_dst_dispatch
//The src-exhaustion check matters when this routine is invoked with
//a per-segment src range (count typically larger than the range);
//it returns control to the outer source-segment loop.
if(BOOST_CONTAINER_SEG_UNLIKELY(count == 0 || first == last))
if(BOOST_UNLIKELY(count == 0 || first == last))
return dst_traits::compose(dst_seg, r.second);
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
@@ -221,14 +221,14 @@ OutIter copy_n_scan(SegIt first, SegIt last, Size& BOOST_RESTRICT count, OutIter
const local_iterator le = last_seg ? traits::local(last) : traits::end(scur);
result = copy_n_scan(lcur, le, count, result, is_local_seg_t(), local_cat_t());
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (last_seg || BOOST_UNLIKELY(!count))
return result;
//Middle segments keep their own call site: begin/end both come from
//scur, so the leaf can be specialised for full segments
for (++scur; scur != slast; ++scur) {
result = copy_n_scan(traits::begin(scur), traits::end(scur), count, result, is_local_seg_t(), local_cat_t());
if (BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (BOOST_UNLIKELY(!count))
return result;
}
@@ -258,7 +258,7 @@ OutIter segmented_copy_n_dispatch
while(1) {
result = copy_n_scan(lcur, traits::end(scur), count, result, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(count == 0))
if(BOOST_UNLIKELY(count == 0))
break;
++scur;
lcur = traits::begin(scur);
@@ -73,7 +73,7 @@ typename boost::container::iterator_traits<SegIter>::difference_type
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
result += (segmented_count_dispatch)(lb, le, value, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -72,7 +72,7 @@ typename boost::container::iterator_traits<SegIter>::difference_type
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
result += (segmented_count_if_dispatch)(lb, le, pred, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -131,7 +131,7 @@ segtrio<SrcIter, SegIter2, bool> segmented_equal_iter2_bounded
const local_result_t r = (segmented_equal_iter2_bounded)
(first1, last1, lb2, le2, pred, iter2_is_local_seg_t(), SrcCat());
first1 = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(last_seg || BOOST_UNLIKELY(r.third))
return result_t(first1, iter2_traits::compose(sfirst, r.second), r.third);
}
@@ -140,7 +140,7 @@ segtrio<SrcIter, SegIter2, bool> segmented_equal_iter2_bounded
(first1, last1, iter2_traits::begin(sfirst), iter2_traits::end(sfirst), pred
, iter2_is_local_seg_t(), SrcCat());
first1 = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(BOOST_UNLIKELY(r.third))
return result_t(first1, iter2_traits::compose(sfirst, r.second), true);
}
@@ -187,7 +187,7 @@ segduo<bool, SegIter2> segmented_equal_iter2_dispatch
(first1, last1, loc2, iter2_traits::end(seg2), pred, iter2_is_local_seg_t(), Cat());
first1 = r.first;
loc2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(BOOST_UNLIKELY(r.third))
break;
++seg2;
loc2 = iter2_traits::begin(seg2);
@@ -240,7 +240,7 @@ segduo<bool, InpIter2> segmented_equal_dispatch
// Clang, so direct threading stays.
segduo<bool, InpIter2> r = (segmented_equal_dispatch)
(lb, le, first2, pred, is_local_seg_t(), local_cat_t());
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(!r.first))
if(last_seg || BOOST_UNLIKELY(!r.first))
return r;
//Middle segments keep their own call site: begin/end both come from
@@ -248,7 +248,7 @@ segduo<bool, InpIter2> segmented_equal_dispatch
for(++sfirst; sfirst != slast; ++sfirst) {
r = (segmented_equal_dispatch)
(traits::begin(sfirst), traits::end(sfirst), r.second, pred, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(!r.first))
if(BOOST_UNLIKELY(!r.first))
return r;
}
@@ -61,7 +61,7 @@ void segmented_fill_range
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
(segmented_fill_range)(lb, le, value, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
break;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -83,9 +83,9 @@ segduo<SegIt, Size> fill_n_scan(SegIt first, SegIt last, Size count, const T& va
{
const segduo<local_iterator, Size> r = fill_n_scan(lb, le, count, value, is_local_seg_t(), local_cat_t());
count = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (BOOST_UNLIKELY(!count))
return segduo<SegIt, Size>(traits::compose(scur, r.first), count);
if (BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if (BOOST_UNLIKELY(last_seg))
return segduo<SegIt, Size>(last, count);
}
@@ -94,7 +94,7 @@ segduo<SegIt, Size> fill_n_scan(SegIt first, SegIt last, Size count, const T& va
for (++scur; scur != slast; ++scur) {
const segduo<local_iterator, Size> r = fill_n_scan(traits::begin(scur), traits::end(scur), count, value, is_local_seg_t(), local_cat_t());
count = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (BOOST_UNLIKELY(!count))
return segduo<SegIt, Size>(traits::compose(scur, r.first), count);
}
@@ -127,7 +127,7 @@ SegIter segmented_fill_n_ref
const segduo<local_iterator, Size> r = fill_n_scan(traits::begin(scur), traits::end(scur), count, value, is_local_seg_t(), local_cat_t());
lcur = r.first;
count = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(count == 0))
if (BOOST_UNLIKELY(count == 0))
break;
++scur;
}
@@ -66,7 +66,7 @@ SegIter segmented_find_dispatch
const local_iterator r = (segmented_find_dispatch)(lb, le, value, is_local_seg_t(), local_cat_t());
if (r != le)
return traits::compose(sfirst, r);
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return last;
//Middle segments keep their own call site: begin/end both come from
@@ -66,7 +66,7 @@ SegIter segmented_find_if_dispatch
const local_iterator r = (segmented_find_if_dispatch)(lb, le, pred, is_local_seg_t(), local_cat_t());
if (r != le)
return traits::compose(sfirst, r);
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return last;
//Middle segments keep their own call site: begin/end both come from
@@ -94,7 +94,7 @@ SegIt find_last_scan(SegIt first, SegIt last, const T& value,
const local_iterator r = find_last_scan(lb, le, value, is_local_seg_t(), local_cat_t());
if (r != le)
result = traits::compose(sfirst, r);
if (BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if (BOOST_UNLIKELY(last_seg))
return result;
}
@@ -138,7 +138,7 @@ SegIt find_last_scan(SegIt first, SegIt last, const T& value, segmented_iterator
const local_iterator r = find_last_scan(lb, le, value, is_local_seg_t(), local_cat_t());
if (r != le)
return traits::compose(slast, r);
if (BOOST_CONTAINER_SEG_UNLIKELY(first_seg))
if (BOOST_UNLIKELY(first_seg))
return last;
}
@@ -94,7 +94,7 @@ SegIt find_last_if_scan(SegIt first, SegIt last, Pred pred,
const local_iterator r = find_last_if_scan(lb, le, pred, is_local_seg_t(), local_cat_t());
if (r != le)
result = traits::compose(sfirst, r);
if (BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if (BOOST_UNLIKELY(last_seg))
return result;
}
@@ -138,7 +138,7 @@ SegIt find_last_if_scan(SegIt first, SegIt last, Pred pred, segmented_iterator_t
const local_iterator r = find_last_if_scan(lb, le, pred, is_local_seg_t(), local_cat_t());
if (r != le)
return traits::compose(slast, r);
if (BOOST_CONTAINER_SEG_UNLIKELY(first_seg))
if (BOOST_UNLIKELY(first_seg))
return last;
}
@@ -64,7 +64,7 @@ F segmented_for_each_dispatch
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
f = (segmented_for_each_dispatch)(lb, le, boost::move(f), is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return boost::move(f);
for(++sfirst; sfirst != slast; ++sfirst)
f = (segmented_for_each_dispatch)(traits::begin(sfirst), traits::end(sfirst), boost::move(f), is_local_seg_t(), local_cat_t());
@@ -61,7 +61,7 @@ void segmented_generate_dispatch
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
(segmented_generate_dispatch)(lb, le, gen, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
break;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -82,9 +82,9 @@ segduo<SegIt, Size> generate_n_scan(SegIt first, SegIt last, Size count, Generat
{
const segduo<local_iterator, Size> r = generate_n_scan(lb, le, count, gen, is_local_seg_t(), local_cat_t());
count = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (BOOST_UNLIKELY(!count))
return segduo<SegIt, Size>(traits::compose(scur, r.first), count);
if (BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if (BOOST_UNLIKELY(last_seg))
return segduo<SegIt, Size>(last, count);
}
@@ -93,7 +93,7 @@ segduo<SegIt, Size> generate_n_scan(SegIt first, SegIt last, Size count, Generat
for (++scur; scur != slast; ++scur) {
const segduo<local_iterator, Size> r = generate_n_scan(traits::begin(scur), traits::end(scur), count, gen, is_local_seg_t(), local_cat_t());
count = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(!count))
if (BOOST_UNLIKELY(!count))
return segduo<SegIt, Size>(traits::compose(scur, r.first), count);
}
@@ -126,7 +126,7 @@ SegIter segmented_generate_n_ref
const segduo<local_iterator, Size> r = generate_n_scan(traits::begin(scur), traits::end(scur), count, gen, is_local_seg_t(), local_cat_t());
lcur = r.first;
count = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(count == 0))
if(BOOST_UNLIKELY(count == 0))
break;
++scur;
}
@@ -421,15 +421,4 @@ struct deepest_local_iterator
#error "Must define either BOOST_CONTAINER_SEGMENTED_ENABLE_PRAGMA_UNROLL or BOOST_CONTAINER_SEGMENTED_DISABLE_PRAGMA_UNROLL"
#endif
// Marks the segment-exhaustion checks inside leaf loops as unlikely: they
// succeed at most once per segment while all other iterations take the
// fall-through path. The LIKELY variant is used when the loop structure
// tests the continue condition instead of the exit condition.
#if !defined(BOOST_CONTAINER_SEG_UNLIKELY)
#define BOOST_CONTAINER_SEG_UNLIKELY(x) BOOST_UNLIKELY(x)
#endif
#if !defined(BOOST_CONTAINER_SEG_LIKELY)
#define BOOST_CONTAINER_SEG_LIKELY(x) BOOST_LIKELY(x)
#endif
#endif // BOOST_CONTAINER_EXPERIMENTAL_SEGMENTED_ITERATOR_TRAITS_HPP
@@ -166,7 +166,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> merge_dst_bounded
, de, comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(last_seg || BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), r.fourth);
}
@@ -178,7 +178,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> merge_dst_bounded
, dst_traits::end(sfirst), comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if (BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), true);
}
@@ -250,7 +250,7 @@ segtrio<Iter1, Iter2, SegDstIter> merge_until_exhausts
// normalises a local iterator sitting on the segment end, the same way
// segmented_copy_dst_dispatch relies on. fourth already answers that
// question, and gives source exhaustion priority on such a tie.
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth)) {
if(BOOST_UNLIKELY(r.fourth)) {
return result_t(first1, first2, dst_traits::compose(dst_seg, dst_local));
}
// dst segment full and both sources still live; advance to the next.
@@ -320,7 +320,7 @@ segtrio<Iter1, SegIter2, OutIter> merge_seg2_dispatch
src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if (last_seg || BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -332,7 +332,7 @@ segtrio<Iter1, SegIter2, OutIter> merge_seg2_dispatch
result, comp, src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if(BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -402,7 +402,7 @@ segtrio<SegIt, InIter2, OutIter> merge_scan
(lcur, le, first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(last_seg || BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -413,7 +413,7 @@ segtrio<SegIt, InIter2, OutIter> merge_scan
(traits::begin(scur), traits::end(scur), first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -126,7 +126,7 @@ segtrio<SrcIter, SegIter2, bool> segmented_mismatch_iter2_bounded
const local_result_t r = (segmented_mismatch_iter2_bounded)
(first1, last1, lb2, le2, pred, iter2_is_local_seg_t(), SrcCat());
first1 = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(last_seg || BOOST_UNLIKELY(r.third))
return result_t(first1, iter2_traits::compose(sfirst, r.second), r.third);
}
@@ -135,7 +135,7 @@ segtrio<SrcIter, SegIter2, bool> segmented_mismatch_iter2_bounded
(first1, last1, iter2_traits::begin(sfirst), iter2_traits::end(sfirst), pred
, iter2_is_local_seg_t(), SrcCat());
first1 = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(BOOST_UNLIKELY(r.third))
return result_t(first1, iter2_traits::compose(sfirst, r.second), true);
}
@@ -170,7 +170,7 @@ segduo<SrcIter, SegIter2> segmented_mismatch_iter2_dispatch
(first1, last1, loc2, iter2_traits::end(seg2), pred, iter2_is_local_seg_t(), Cat());
first1 = r.first;
loc2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.third))
if(BOOST_UNLIKELY(r.third))
break;
++seg2;
loc2 = iter2_traits::begin(seg2);
@@ -266,9 +266,9 @@ segduo<SegIter, InpIter2> segmented_mismatch_bounded_dispatch
(lb, le, first2, last2, pred, is_local_seg_t(), local_cat_t());
first2 = r.second;
// Early exit: stopped inside segment (mismatch) or iter2 exhausted.
if (BOOST_CONTAINER_SEG_UNLIKELY(r.first != le || first2 == last2))
if (BOOST_UNLIKELY(r.first != le || first2 == last2))
return return_t(traits::compose(sfirst, r.first), first2);
if (BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if (BOOST_UNLIKELY(last_seg))
return return_t(last1, first2);
}
@@ -279,7 +279,7 @@ segduo<SegIter, InpIter2> segmented_mismatch_bounded_dispatch
const local_return_t r = (segmented_mismatch_bounded_dispatch)
(traits::begin(sfirst), me, first2, last2, pred, is_local_seg_t(), local_cat_t());
first2 = r.second;
if (BOOST_CONTAINER_SEG_UNLIKELY(r.first != me || first2 == last2))
if (BOOST_UNLIKELY(r.first != me || first2 == last2))
return return_t(traits::compose(sfirst, r.first), first2);
}
@@ -65,7 +65,7 @@ bool segmented_none_of_dispatch
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
if(!(segmented_none_of_dispatch)(lb, le, pred, is_local_seg_t(), local_cat_t()))
return false;
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return true;
//Middle segments keep their own call site: begin/end both come from
@@ -69,7 +69,7 @@ OutIter partition_scan(SegIt first, SegIt last, OutIter result, Pred pred, segme
const bool last_seg = scur == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(scur);
result = partition_scan(lcur, le, result, pred, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++scur; scur != slast; ++scur)
@@ -140,9 +140,9 @@ partition_copy_leaf
// untested element, and the loop body can take for granted that both outputs
// have room. With unreachable_sentinel_t outputs the tests fold away, so the
// flat path is unchanged.
if(BOOST_CONTAINER_SEG_UNLIKELY(t_first == t_last))
if(BOOST_UNLIKELY(t_first == t_last))
return segquartet<SrcIter, TIter, FIter, bool>(first, t_first, f_first, false);
if(BOOST_CONTAINER_SEG_UNLIKELY(f_first == f_last))
if(BOOST_UNLIKELY(f_first == f_last))
return segquartet<SrcIter, TIter, FIter, bool>(first, t_first, f_first, first != last);
bool false_output_full = false;
@@ -151,7 +151,7 @@ partition_copy_leaf
if(pred(*first)) {
*t_first = *first;
++t_first;
if(BOOST_CONTAINER_SEG_UNLIKELY(t_first == t_last)) {
if(BOOST_UNLIKELY(t_first == t_last)) {
++first;
break;
}
@@ -159,7 +159,7 @@ partition_copy_leaf
else {
*f_first = *first;
++f_first;
if(BOOST_CONTAINER_SEG_UNLIKELY(f_first == f_last)) {
if(BOOST_UNLIKELY(f_first == f_last)) {
++first;
false_output_full = first != last;
break;
@@ -256,7 +256,7 @@ partition_copy_false_bounded
(first, last, t_first, t_last, fb, fe, pred, floc_seg_t(), cat);
first = r.first;
t_first = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(!r.fourth))
if(last_seg || BOOST_UNLIKELY(!r.fourth))
return segquartet<SrcIter, TIter, SegFIter, bool>
(first, t_first, ftr::compose(fsfirst, r.third), r.fourth);
}
@@ -268,7 +268,7 @@ partition_copy_false_bounded
(first, last, t_first, t_last, ftr::begin(fsfirst), ftr::end(fsfirst), pred, floc_seg_t(), cat);
first = r.first;
t_first = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(!r.fourth))
if(BOOST_UNLIKELY(!r.fourth))
return segquartet<SrcIter, TIter, SegFIter, bool>
(first, t_first, ftr::compose(fsfirst, r.third), false);
}
@@ -316,7 +316,7 @@ partition_copy_false_dispatch
(first, last, t_first, t_last, f_lo, ftr::end(fs), pred, floc_seg_t(), cat);
first = r.first;
t_first = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(!r.fourth))
if(BOOST_UNLIKELY(!r.fourth))
return segtrio<SrcIter, TIter, SegFIter>(first, t_first, ftr::compose(fs, r.third));
++fs;
f_lo = ftr::begin(fs);
@@ -373,7 +373,7 @@ partition_copy_true_bounded
(first, last, tb, te, f_first, pred, tloc_seg_t(), f_tag, cat);
first = r.first;
f_first = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segtrio<SrcIter, SegTIter, FIter>(first, ttr::compose(tsfirst, r.second), f_first);
}
@@ -384,7 +384,7 @@ partition_copy_true_bounded
(first, last, ttr::begin(tsfirst), ttr::end(tsfirst), f_first, pred, tloc_seg_t(), f_tag, cat);
first = r.first;
f_first = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segtrio<SrcIter, SegTIter, FIter>(first, ttr::compose(tsfirst, r.second), f_first);
}
@@ -429,7 +429,7 @@ partition_copy_true_dispatch
(first, last, t_lo, ttr::end(ts), f_first, pred, tloc_seg_t(), f_tag, cat);
first = r.first;
f_first = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segtrio<SrcIter, SegTIter, FIter>(first, ttr::compose(ts, r.second), f_first);
++ts;
t_lo = ttr::begin(ts);
@@ -484,7 +484,7 @@ segmented_partition_copy_dispatch
// and it measured +3.6% on these walkers under GCC and +0.1% under
// Clang, so direct threading stays.
pair_t p = (segmented_partition_copy_dispatch)(lb, le, out_true, out_false, pred, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return p;
//Middle segments keep their own call site: begin/end both come from
@@ -68,7 +68,7 @@ SegIter segmented_partition_point_dispatch
(lb, le, pred, is_local_seg_t(), local_cat_t());
if (r != le)
return traits::compose(scur, r);
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return last;
//middle segments keep their own call site: begin/end both come from
@@ -46,7 +46,7 @@ segmented_remove_copy_dst_bounded
//already moved past the element that was written, so the next call resumes on
//an uncompared element. With an unreachable_sentinel_t destination both
//checks fold away, so the flat path is unchanged.
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
return segduo<SrcIter, DstIter>(first, dst_first);
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
@@ -54,7 +54,7 @@ segmented_remove_copy_dst_bounded
if(!(*first == value)) {
transfer_op<Move>::apply(*dst_first, *first);
++dst_first;
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
++first;
goto out_path;
}
@@ -128,7 +128,7 @@ segduo<SrcIter, SegDstIter> segmented_remove_copy_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_dst_bounded<Move>)
(first, last, db, de, value, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -136,7 +136,7 @@ segduo<SrcIter, SegDstIter> segmented_remove_copy_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_dst_bounded<Move>)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), value, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -176,7 +176,7 @@ SegDstIter segmented_remove_copy_dst_dispatch
while(1) {
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_dst_bounded<Move>)
(first, last, dst_local, dst_traits::end(dst_seg), value, dst_is_local_seg_t(), Cat());
if(BOOST_CONTAINER_SEG_LIKELY(r.first != last)) {
if(BOOST_LIKELY(r.first != last)) {
first = r.first;
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
@@ -225,7 +225,7 @@ OutIter segmented_remove_copy_dispatch
const src_local_iterator le = last_seg ? src_traits::local(last) : src_traits::end(sfirst);
result = (segmented_remove_copy_dispatch<Move>)
(lb, le, result, value, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -59,7 +59,7 @@ segmented_remove_copy_if_dst_bounded
//past the element that was written, so the next call resumes on an untested
//element. With an unreachable_sentinel_t destination both checks fold away,
//so the flat path is unchanged.
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
return segduo<SrcIter, DstIter>(first, dst_first);
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
@@ -67,7 +67,7 @@ segmented_remove_copy_if_dst_bounded
if(!pred(*first)) {
transfer_op<Move>::apply(*dst_first, *first);
++dst_first;
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
++first;
goto out_path;
}
@@ -141,7 +141,7 @@ segduo<SrcIter, SegDstIter> segmented_remove_copy_if_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_if_dst_bounded<Move>)
(first, last, db, de, pred, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -149,7 +149,7 @@ segduo<SrcIter, SegDstIter> segmented_remove_copy_if_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_if_dst_bounded<Move>)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), pred, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -193,7 +193,7 @@ SegDstIter segmented_remove_copy_if_dst_dispatch
const segduo<SrcIter, dst_local_iterator> r = (segmented_remove_copy_if_dst_bounded<Move>)
(first, last, dst_local, dst_end, pred, dst_is_local_seg_t(), Cat());
first = r.first;
if(BOOST_CONTAINER_SEG_LIKELY(first != last)) {
if(BOOST_LIKELY(first != last)) {
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
}
@@ -241,7 +241,7 @@ OutIter segmented_remove_copy_if_dispatch
const src_local_iterator le = last_seg ? src_traits::local(last) : src_traits::end(sfirst);
result = (segmented_remove_copy_if_dispatch<Move>)
(lb, le, result, pred, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -63,7 +63,7 @@ void segmented_replace_dispatch
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
(segmented_replace_dispatch)(lb, le, old_val, new_val, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
break;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -63,7 +63,7 @@ void segmented_replace_if_dispatch
const bool last_seg = sfirst == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(sfirst);
(segmented_replace_if_dispatch)(lb, le, pred, new_val, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
break;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -48,7 +48,7 @@ segmented_reverse_copy_dst_bounded
{
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
while(first != last) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
goto out_path;
--last;
*dst_first = *last;
@@ -96,7 +96,7 @@ segduo<BidirIter, SegDstIter> segmented_reverse_copy_dst_bounded
const segduo<BidirIter, dst_local_iterator> r = (segmented_reverse_copy_dst_bounded)
(first, last, db, de, dst_is_local_seg_t(), SrcCat());
last = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<BidirIter, SegDstIter>(last, dst_traits::compose(sfirst, r.second));
}
@@ -104,7 +104,7 @@ segduo<BidirIter, SegDstIter> segmented_reverse_copy_dst_bounded
const segduo<BidirIter, dst_local_iterator> r = (segmented_reverse_copy_dst_bounded)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), dst_is_local_seg_t(), SrcCat());
last = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<BidirIter, SegDstIter>(last, dst_traits::compose(sfirst, r.second));
}
@@ -148,7 +148,7 @@ SegDstIter segmented_reverse_copy_dst_dispatch
const segduo<BidirIter, dst_local_iterator> r = (segmented_reverse_copy_dst_bounded)
(first, last, dst_local, dst_end, dst_is_local_seg_t(), Cat());
last = r.first;
if(BOOST_CONTAINER_SEG_LIKELY(first != last)) {
if(BOOST_LIKELY(first != last)) {
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
}
@@ -193,7 +193,7 @@ OutIter segmented_reverse_copy_dispatch
const bool first_seg = sfirst == slast;
const local_iterator lb = first_seg ? traits::local(first) : traits::begin(slast);
result = (segmented_reverse_copy_dispatch)(lb, le, result, is_local_seg_t(), local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(first_seg))
if(BOOST_UNLIKELY(first_seg))
return result;
//Middle segments (in reverse) keep their own call site: begin/end both
@@ -303,7 +303,7 @@ segtrio<bool, Size, SegIter> search_n_scan_segment
match_start = traits::compose(scur, r.third);
if(r.first)
return result_t(true, consecutive, match_start);
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result_t(false, consecutive, match_start);
}
@@ -63,7 +63,7 @@ set_difference_dst_bounded
bool src_done = true;
while(first1 != last1 && first2 != last2) {
if (comp(*first1, *first2)) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
src_done = false;
break;
}
@@ -156,7 +156,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_difference_dst_bounded
, de, comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(last_seg || BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), r.fourth);
}
@@ -168,7 +168,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_difference_dst_bounded
, dst_traits::end(sfirst), comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), true);
}
@@ -233,7 +233,7 @@ segtrio<Iter1, Iter2, SegDstIter> set_difference_until_exhausts
// normalises a local iterator sitting on the segment end, the same way
// segmented_copy_dst_dispatch relies on. fourth already answers that
// question, and gives source exhaustion priority on such a tie.
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth)) {
if(BOOST_UNLIKELY(r.fourth)) {
return result_t(first1, first2, dst_traits::compose(dst_seg, dst_local));
}
// dst segment full and both sources still live; advance to the next.
@@ -290,7 +290,7 @@ segtrio<Iter1, SegIter2, OutIter> set_difference_seg2_dispatch
src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if (last_seg || BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -302,7 +302,7 @@ segtrio<Iter1, SegIter2, OutIter> set_difference_seg2_dispatch
result, comp, src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if(BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -360,7 +360,7 @@ segtrio<SegIt, InIter2, OutIter> set_difference_scan
(lcur, le, first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(last_seg || BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -371,7 +371,7 @@ segtrio<SegIt, InIter2, OutIter> set_difference_scan
(traits::begin(scur), traits::end(scur), first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -62,7 +62,7 @@ set_intersection_dst_bounded
if (comp(*first1, *first2)) { ++first1; }
else if (comp(*first2, *first1)) { ++first2; }
else {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
src_done = false;
break;
}
@@ -143,7 +143,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_intersection_dst_bounded
, de, comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(last_seg || BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), r.fourth);
}
@@ -155,7 +155,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_intersection_dst_bounded
, dst_traits::end(sfirst), comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), true);
}
@@ -220,7 +220,7 @@ segtrio<Iter1, Iter2, SegDstIter> set_intersection_until_exhausts
// normalises a local iterator sitting on the segment end, the same way
// segmented_copy_dst_dispatch relies on. fourth already answers that
// question, and gives source exhaustion priority on such a tie.
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth)) {
if(BOOST_UNLIKELY(r.fourth)) {
return result_t(first1, first2, dst_traits::compose(dst_seg, dst_local));
}
// dst segment full and both sources still live; advance to the next.
@@ -277,7 +277,7 @@ segtrio<Iter1, SegIter2, OutIter> set_intersection_seg2_dispatch
src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if (last_seg || BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -289,7 +289,7 @@ segtrio<Iter1, SegIter2, OutIter> set_intersection_seg2_dispatch
result, comp, src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if(BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -347,7 +347,7 @@ segtrio<SegIt, InIter2, OutIter> set_intersection_scan
(lcur, le, first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(last_seg || BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -358,7 +358,7 @@ segtrio<SegIt, InIter2, OutIter> set_intersection_scan
(traits::begin(scur), traits::end(scur), first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -63,7 +63,7 @@ set_symmetric_difference_dst_bounded
bool src_done = true;
while(first1 != last1 && first2 != last2) {
if (comp(*first1, *first2)) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
src_done = false;
break;
}
@@ -73,7 +73,7 @@ set_symmetric_difference_dst_bounded
}
else {
if (comp(*first2, *first1)) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
src_done = false;
break;
}
@@ -174,7 +174,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_symmetric_difference_dst_bounded
, de, comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(last_seg || BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), r.fourth);
}
@@ -186,7 +186,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_symmetric_difference_dst_bounded
, dst_traits::end(sfirst), comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), true);
}
@@ -251,7 +251,7 @@ segtrio<Iter1, Iter2, SegDstIter> set_symmetric_difference_until_exhausts
// normalises a local iterator sitting on the segment end, the same way
// segmented_copy_dst_dispatch relies on. fourth already answers that
// question, and gives source exhaustion priority on such a tie.
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth)) {
if(BOOST_UNLIKELY(r.fourth)) {
return result_t(first1, first2, dst_traits::compose(dst_seg, dst_local));
}
// dst segment full and both sources still live; advance to the next.
@@ -308,7 +308,7 @@ segtrio<Iter1, SegIter2, OutIter> set_symmetric_difference_seg2_dispatch
src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if (last_seg || BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -320,7 +320,7 @@ segtrio<Iter1, SegIter2, OutIter> set_symmetric_difference_seg2_dispatch
result, comp, src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if(BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -378,7 +378,7 @@ segtrio<SegIt, InIter2, OutIter> set_symmetric_difference_scan
(lcur, le, first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(last_seg || BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -389,7 +389,7 @@ segtrio<SegIt, InIter2, OutIter> set_symmetric_difference_scan
(traits::begin(scur), traits::end(scur), first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -56,7 +56,7 @@ set_union_dst_bounded
{
bool src_done = true;
while(first1 != last1 && first2 != last2) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last)) {
if(BOOST_UNLIKELY(dst_first == dst_last)) {
src_done = false;
break;
}
@@ -138,7 +138,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_union_dst_bounded
, de, comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(last_seg || BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), r.fourth);
}
@@ -150,7 +150,7 @@ segquartet<Iter1, Iter2, SegDstIter, bool> set_union_dst_bounded
, dst_traits::end(sfirst), comp, dst_is_local_seg_t(), SrcCat());
first1 = r.first;
first2 = r.second;
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth))
if(BOOST_UNLIKELY(r.fourth))
return result_t(first1, first2, dst_traits::compose(sfirst, r.third), true);
}
@@ -215,7 +215,7 @@ segtrio<Iter1, Iter2, SegDstIter> set_union_until_exhausts
// normalises a local iterator sitting on the segment end, the same way
// segmented_copy_dst_dispatch relies on. fourth already answers that
// question, and gives source exhaustion priority on such a tie.
if(BOOST_CONTAINER_SEG_UNLIKELY(r.fourth)) {
if(BOOST_UNLIKELY(r.fourth)) {
return result_t(first1, first2, dst_traits::compose(dst_seg, dst_local));
}
// dst segment full and both sources still live; advance to the next.
@@ -272,7 +272,7 @@ segtrio<Iter1, SegIter2, OutIter> set_union_seg2_dispatch
src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if (last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if (last_seg || BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -284,7 +284,7 @@ segtrio<Iter1, SegIter2, OutIter> set_union_seg2_dispatch
result, comp, src2_is_local_seg_t(), cat);
first1 = r.first;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first1 == last1))
if(BOOST_UNLIKELY(first1 == last1))
return result_t(first1, src2_traits::compose(sf2, r.second), result);
}
@@ -342,7 +342,7 @@ segtrio<SegIt, InIter2, OutIter> set_union_scan
(lcur, le, first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(last_seg || BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -353,7 +353,7 @@ segtrio<SegIt, InIter2, OutIter> set_union_scan
(traits::begin(scur), traits::end(scur), first2, last2, result, comp, is_local_seg_t());
first2 = r.second;
result = r.third;
if(BOOST_CONTAINER_SEG_UNLIKELY(first2 == last2))
if(BOOST_UNLIKELY(first2 == last2))
return result_t(traits::compose(scur, r.first), first2, result);
}
@@ -105,7 +105,7 @@ OuterIter stable_partition_scan(SegIt first, SegIt last, OuterIter result,
const bool last_seg = scur == slast;
const local_iterator le = last_seg ? traits::local(last) : traits::end(scur);
result = stable_partition_scan(lcur, le, result, composer_t(composer, scur), pred, is_local_seg_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++scur; scur != slast; ++scur) {
result = stable_partition_scan(traits::begin(scur), traits::end(scur), result, composer_t(composer, scur), pred, is_local_seg_t());
@@ -39,7 +39,7 @@ segmented_swap_ranges_dst_bounded
{
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
for(; first != last; ++first) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
goto out_path;
boost::adl_move_swap(*first, *dst_first);
++dst_first;
@@ -86,7 +86,7 @@ segduo<SrcIter, SegDstIter> segmented_swap_ranges_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_swap_ranges_dst_bounded)
(first, last, db, de, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -94,7 +94,7 @@ segduo<SrcIter, SegDstIter> segmented_swap_ranges_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_swap_ranges_dst_bounded)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), dst_is_local_seg_t(), SrcCat());
first = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -138,7 +138,7 @@ SegDstIter segmented_swap_ranges_dst_dispatch
const segduo<SrcIter, dst_local_iterator> r = (segmented_swap_ranges_dst_bounded)
(first, last, dst_local, dst_end, dst_is_local_seg_t(), Cat());
first = r.first;
if(BOOST_CONTAINER_SEG_LIKELY(first != last)) {
if(BOOST_LIKELY(first != last)) {
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
}
@@ -182,7 +182,7 @@ FwdIt2 segmented_swap_ranges_dispatch (SegIter first1, SegIter last1, FwdIt2 fir
const src_local_iterator le = last_seg ? src_traits::local(last1) : src_traits::end(sfirst);
first2 = (segmented_swap_ranges_dispatch)
(lb, le, first2, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return first2;
for(++sfirst; sfirst != slast; ++sfirst)
@@ -38,7 +38,7 @@ segmented_transform_dst_bounded
{
BOOST_CONTAINER_SEGMENTED_UNROLL(4)
for(; first != last; ++first) {
if(BOOST_CONTAINER_SEG_UNLIKELY(dst_first == dst_last))
if(BOOST_UNLIKELY(dst_first == dst_last))
goto out_path;
*dst_first = op(*first);
++dst_first;
@@ -85,7 +85,7 @@ segduo<SrcIter, SegDstIter> segmented_transform_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_transform_dst_bounded)
(first, last, db, de, op, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(last_seg || BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(last_seg || BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -93,7 +93,7 @@ segduo<SrcIter, SegDstIter> segmented_transform_dst_bounded
const segduo<SrcIter, dst_local_iterator> r = (segmented_transform_dst_bounded)
(first, last, dst_traits::begin(sfirst), dst_traits::end(sfirst), op, dst_is_local_seg_t(), SrcCat());
first = r.first;
if(BOOST_CONTAINER_SEG_UNLIKELY(first == last))
if(BOOST_UNLIKELY(first == last))
return segduo<SrcIter, SegDstIter>(first, dst_traits::compose(sfirst, r.second));
}
@@ -137,7 +137,7 @@ SegDstIter segmented_transform_dst_dispatch
const segduo<SrcIter, dst_local_iterator> r = (segmented_transform_dst_bounded)
(first, last, dst_local, dst_end, op, dst_is_local_seg_t(), Cat());
first = r.first;
if(BOOST_CONTAINER_SEG_LIKELY(first != last)) {
if(BOOST_LIKELY(first != last)) {
++dst_seg;
dst_local = dst_traits::begin(dst_seg);
}
@@ -183,7 +183,7 @@ OutIter segmented_transform_dispatch
const src_local_iterator le = last_seg ? src_traits::local(last) : src_traits::end(sfirst);
result = (segmented_transform_dispatch)
(lb, le, result, op, src_is_local_seg_t(), src_local_cat_t());
if(BOOST_CONTAINER_SEG_UNLIKELY(last_seg))
if(BOOST_UNLIKELY(last_seg))
return result;
for(++sfirst; sfirst != slast; ++sfirst)