Skip to content

Commit

Permalink
Minor fixes to exclusive_scan algorithm
Browse files Browse the repository at this point in the history
- removed unneeded temporary variable
  • Loading branch information
hkaiser committed Jan 19, 2018
1 parent 57730a9 commit 24831ed
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions hpx/parallel/algorithms/exclusive_scan.hpp
Expand Up @@ -48,12 +48,10 @@ namespace hpx { namespace parallel { inline namespace v1
OutIter sequential_exclusive_scan(InIter first, InIter last,
OutIter dest, T init, Op && op, Conv && conv = Conv())
{
T temp = init;
for (/* */; first != last; (void) ++first, ++dest)
{
init = hpx::util::invoke(op, init, hpx::util::invoke(conv, *first));
*dest = temp;
temp = init;
*dest = init;
init = hpx::util::invoke(op, init, hpx::util::invoke(conv, *first));
}
return dest;
}
Expand All @@ -63,12 +61,10 @@ namespace hpx { namespace parallel { inline namespace v1
T sequential_exclusive_scan_n(InIter first, std::size_t count,
OutIter dest, T init, Op && op, Conv && conv = Conv())
{
T temp = init;
for (/* */; count-- != 0; (void) ++first, ++dest)
{
*dest = init;
init = hpx::util::invoke(op, init, hpx::util::invoke(conv, *first));
*dest = temp;
temp = init;
}
return init;
}
Expand Down Expand Up @@ -128,7 +124,6 @@ namespace hpx { namespace parallel { inline namespace v1
zip_iterator part_begin, std::size_t part_size,
hpx::shared_future<T> curr, hpx::shared_future<T> next)
{

next.get(); // rethrow exceptions

T val = curr.get();
Expand Down

0 comments on commit 24831ed

Please sign in to comment.