Skip to content

Commit

Permalink
Merge pull request #788 from u-s/bugfix/variable-shadowing-simple-mov…
Browse files Browse the repository at this point in the history
…ing-average

fix variable shadowing in check_results(simple moving average example)
  • Loading branch information
jszuppe committed Dec 27, 2018
2 parents be85263 + 217f77a commit 61d18ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/simple_moving_average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool check_results(const std::vector<float>& values, const std::vector<float>& s

int semiWidth = wSize/2;

bool res = true;
bool ret = true;
for(int idx = 0 ; idx < size ; ++idx)
{
int start = (std::max)(idx - semiWidth,0);
Expand All @@ -76,11 +76,11 @@ bool check_results(const std::vector<float>& values, const std::vector<float>& s
if(std::abs(res-smoothValues[idx]) > 1e-3)
{
std::cout << "idx = " << idx << " -- expected = " << res << " -- result = " << smoothValues[idx] << std::endl;
res = false;
ret = false;
}
}

return res;
return ret;
}

// generate a uniform law over [0,10]
Expand Down

0 comments on commit 61d18ce

Please sign in to comment.