<execution>: comment early return control flow (#849)

Fixes #818.
This commit is contained in:
Alex Guteniev 2020-05-30 03:33:46 +03:00 коммит произвёл GitHub
Родитель ba739dc6a2
Коммит c4c482105a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -1042,7 +1042,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1
return _Result;
}
// PARALLEL FUNCTION TEMPLATE all_of
template <bool _Invert, class _FwdIt, class _Pr>
struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task scheduled on the system thread pool
@ -1066,6 +1065,8 @@ struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task schedu
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// GH-818: https://github.com/microsoft/STL/issues/818
const auto _Range = _Basis._Get_chunk(_Key);
for (auto _First = _Range._First; _First != _Range._Last; ++_First) {
@ -1295,6 +1296,7 @@ struct _Static_partitioned_find2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Range = _Basis._Get_chunk(_Key);
const auto _This_find = _Fx(_Range._First, _Range._Last);
@ -1500,6 +1502,7 @@ struct _Static_partitioned_find_end_backward2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Chunk_number = _Key._Chunk_number;
const auto _Range = _Basis._Get_chunk(_Key);
@ -1620,6 +1623,7 @@ struct _Static_partitioned_adjacent_find2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Chunk_number = _Key._Chunk_number;
const auto _Range = _Basis._Get_chunk(_Key);
@ -1835,6 +1839,7 @@ struct _Static_partitioned_mismatch2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Chunk_number = _Key._Chunk_number;
const auto _Range1 = _Basis1._Get_chunk(_Key);
@ -1966,6 +1971,7 @@ struct _Static_partitioned_equal2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Range1 = _Basis1._Get_chunk(_Key);
const auto _Range2_first = _Basis2._Get_chunk(_Key)._First;
@ -2084,6 +2090,7 @@ struct _Static_partitioned_search2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Range = _Basis._Get_chunk(_Key);
for (auto _Candidate = _Range._First; _Candidate != _Range._Last; ++_Candidate) {
@ -2202,6 +2209,7 @@ struct _Static_partitioned_search_n2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Range = _Basis._Get_chunk(_Key);
@ -3054,6 +3062,7 @@ struct _Static_partitioned_is_sorted_until {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
auto _Range = _Basis._Get_chunk(_Key);
auto _Next = _Range._First;
@ -3169,6 +3178,7 @@ struct _Static_partitioned_is_partitioned {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// looking at chunks from either end, moving in towards the middle
auto _Target_chunk_number = _Key._Chunk_number >> 1;
@ -3281,6 +3291,7 @@ struct _Static_partitioned_is_heap_until {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
const auto _Chunk_range_size = _Key._Size;
const auto _Chunk_offset = _Key._Start_at;