Skip to content

Commit

Permalink
Remove Structured Binding
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbeattie42 committed Nov 27, 2024
1 parent e46a3a9 commit 761264b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions OpenSim/Common/TableUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int TableUtilities::findStateLabelIndexInternal(const std::string* begin,
}

template <typename T>
std::pair<bool, double> isUniform(const std::vector<T>& x) {
bool isUniform(const std::vector<T>& x) {

// Initialize step as NaN
T step = std::numeric_limits<T>::quiet_NaN();
Expand Down Expand Up @@ -154,9 +154,8 @@ std::pair<bool, double> isUniform(const std::vector<T>& x) {
if (!tf && x.size() == 2) {
tf = true; // Handle special case for two elements
}
if (tf) { step = mean_step; }

return {tf, step};
return tf;
}

void TableUtilities::filterLowpass(
Expand All @@ -180,7 +179,7 @@ void TableUtilities::filterLowpass(
OPENSIM_THROW_IF(
dtMin < SimTK::Eps, Exception, "Storage cannot be resampled.");

const auto [uniformlySampled, sampleRate] = isUniform(time);
const bool uniformlySampled = isUniform(time);

// Resample if the sampling interval is not uniform.
if (!uniformlySampled) {
Expand Down

0 comments on commit 761264b

Please sign in to comment.