Skip to content

Commit

Permalink
[MISC] pairwise_combine: compute size only once (#2059)
Browse files Browse the repository at this point in the history
* [MISC pairwise_combine: compute size only once

Co-authored-by: rrahn <[email protected]>
  • Loading branch information
marehr and rrahn authored Aug 28, 2020
1 parent 8805266 commit bd513f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/seqan3/range/views/pairwise_combine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ class pairwise_combine_view : public std::ranges::view_interface<pairwise_combin
requires std::ranges::sized_range<underlying_range_type>
//!\endcond
{
return (std::ranges::size(u_range) * (std::ranges::size(u_range) - 1) / 2);
auto const size = std::ranges::size(u_range);
return (size * (size - 1)) / 2;
}
//!\}

Expand Down

0 comments on commit bd513f4

Please sign in to comment.