Skip to content

Commit

Permalink
use std::max_element and std::min_element seperately to avoid unused …
Browse files Browse the repository at this point in the history
…variable
  • Loading branch information
Yuuichi Asahi committed Oct 2, 2024
1 parent d43632f commit fdec8db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/src/KokkosFFT_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ bool is_out_of_range_value_included(const ContainerType& values, IntType max) {
static_assert(std::is_same_v<value_type, IntType>,
"is_out_of_range_value_included: Container value type must "
"match IntType");
const auto [vmin, vmax] = std::minmax_element(values.begin(), values.end());
const auto vmax = std::max_element(values.begin(), values.end());
if constexpr (std::is_signed_v<value_type>) {
const auto vmin = std::min_element(values.begin(), values.end());
KOKKOSFFT_THROW_IF(
*vmin < 0,
"is_out_of_range_value_included: values must be non-negative");
Expand Down

0 comments on commit fdec8db

Please sign in to comment.