Commit 347db901 authored by Cédric Traizet's avatar Cédric Traizet

ENH: extract variables outside of the loop and make getter const

parent 5b3b6bd2
Pipeline #229 passed with stage
in 35 minutes and 49 seconds
......@@ -93,15 +93,20 @@ public:
OffsetType off;
auto externalRadius = in.GetRadius();
// Cache radiuses attributes for threading performances
const int internalRadiusX = m_InternalRadiusX;
const int internalRadiusY = m_InternalRadiusY;
// Cache radiuses attributes for threading performances
const int externalRadiusX = static_cast<int>(externalRadius[0]);
const int externalRadiusY = static_cast<int>(externalRadius[0]);
auto externalRadius = in.GetRadius();
for (int y = -static_cast<int>(externalRadius[1]); y <= static_cast<int>(externalRadius[1]); y++)
for (int y = -externalRadiusY; y <= externalRadiusY; y++)
{
off[1] = y;
for (int x = -static_cast<int>(externalRadius[0]); x <= static_cast<int>(externalRadius[0]); x++)
for (int x = -externalRadiusX; x <= externalRadiusX; x++)
{
off[0] = x;
if ((abs(x) > internalRadiusX) || (abs(y) > internalRadiusY))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment