Skip to content

Commit

Permalink
Declare initial_value as const
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKopienko committed Oct 22, 2021
1 parent 80df395 commit bd43651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ inclusive_scan_by_segment_impl(Policy&& policy, InputIterator1 first1, InputIter
if (n <= 0)
return result;

ValueType initial_value = internal::get_data_0<ValueType>(policy, first2);
const ValueType initial_value = internal::get_data_0<ValueType>(policy, first2);

if (n == 1)
{
Expand Down
2 changes: 1 addition & 1 deletion include/oneapi/dpl/internal/reduce_by_segment_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ reduce_by_segment_impl(Policy&& policy, InputIterator1 first1, InputIterator1 la
return ::std::make_pair(result1, result2);
if (n == 1)
{
ValueType initial_value = internal::get_data_0<ValueType>(policy, first2);
const ValueType initial_value = internal::get_data_0<ValueType>(policy, first2);

internal::set_data_0(policy, result1, internal::get_data_0<DerefValueType>(policy, first1));
internal::set_data_0(policy, result2, initial_value);
Expand Down

0 comments on commit bd43651

Please sign in to comment.