Compositor: Silence -Wself-assign

Use member initializer list for constructor.
Use `this->` for member function.
Introduced in rBef53859d24a9720882e3ca6c5415faefec6fb82c

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10653
This commit is contained in:
Ankit Meel 2021-03-09 19:19:21 +05:30
parent be6b3923f5
commit cdb0b3cedc
2 changed files with 6 additions and 12 deletions

@ -19,18 +19,11 @@
#include "COM_ChunkOrderHotspot.h"
#include <cmath>
ChunkOrderHotspot::ChunkOrderHotspot(int x, int y, float addition)
{
x = x;
y = y;
addition = addition;
}
double ChunkOrderHotspot::calc_distance(int x, int y)
{
int dx = x - x;
int dy = y - y;
int dx = this->x - x;
int dy = this->y - y;
double result = sqrt((double)(dx * dx + dy * dy));
result += (double)addition;
result += (double)this->addition;
return result;
}

@ -27,8 +27,9 @@ struct ChunkOrderHotspot {
int y;
float addition;
public:
ChunkOrderHotspot(int x, int y, float addition);
ChunkOrderHotspot(int x, int y, float addition) : x(x), y(y), addition(addition)
{
}
double calc_distance(int x, int y);