1
0
Fork 0

Codechange: const correctness

pull/13515/head
Susan 2025-02-12 15:38:28 +00:00
parent d253de7269
commit 685cee5bf3
1 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ struct BlobHarmonic
* @param harmonics a std::vector of the harmonics data. * @param harmonics a std::vector of the harmonics data.
* @param noOfSegments How many segments make up the polygon. * @param noOfSegments How many segments make up the polygon.
*/ */
std::vector<Point> CreateStarShapedPolygon(const int radius, std::vector<BlobHarmonic> harmonics, const int noOfSegments) std::vector<Point> CreateStarShapedPolygon(const int radius, const std::vector<BlobHarmonic> harmonics, const int noOfSegments)
{ {
std::vector<Point> result; std::vector<Point> result;
@ -208,7 +208,7 @@ std::vector<Point> CreateStarShapedPolygon(const int radius, std::vector<BlobHar
{ {
float deviation = 0; float deviation = 0;
//add up the values of each harmonic at this segment //add up the values of each harmonic at this segment
std::for_each(harmonics.begin(), harmonics.end(), [&deviation, theta](BlobHarmonic &harmonic) { std::for_each(harmonics.begin(), harmonics.end(), [&deviation, theta](const BlobHarmonic &harmonic) {
deviation += sin((theta + harmonic.phase) * harmonic.frequency) * harmonic.amplitude; deviation += sin((theta + harmonic.phase) * harmonic.frequency) * harmonic.amplitude;
}); });