Skip to content

Commit

Permalink
Removed some unnecessary explicit static_casts
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Stone committed Apr 14, 2021
1 parent 80aa032 commit 00d56c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <class T>
T dsp::calculateEnergy(typename std::vector<T>::iterator start,
typename std::vector<T>::iterator end)
{
return static_cast<T>(std::inner_product(start, end, start, T{ 0.0 }));
return std::inner_product(start, end, start, T(0));
}

template <class T>
Expand All @@ -45,7 +45,7 @@ T dsp::calculateMeanPower(typename std::vector<T>::iterator start,
{
auto energy = calculateEnergy<T>(start, end);
auto numSamples = std::distance(start, end);
return static_cast<T>(energy / numSamples);
return energy / numSamples;
}

template <class T>
Expand Down

0 comments on commit 00d56c4

Please sign in to comment.