Skip to content

Commit

Permalink
refactor: remove useless initialization in blur (#2922)
Browse files Browse the repository at this point in the history
the gaussian_blur_5x5_() method already initializes it

And it was wrong anyway; it initializes the same array 4 times,
and left the other 3 uninitialized.
  • Loading branch information
rodolforg committed Jan 1, 2023
1 parent 1e0d777 commit 41389cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions synfig-core/src/synfig/blur.cpp
Expand Up @@ -951,13 +951,6 @@ bool Blur::operator()(const synfig::surface<float> &surface,
float *SC2=new float[w+2];
float *SC3=new float[w+2];

memset(SC0,0,(w+2)*sizeof(float));
memset(SC0,0,(w+2)*sizeof(float));
memset(SC0,0,(w+2)*sizeof(float));
memset(SC0,0,(w+2)*sizeof(float));

//int i = 0;

while(bw&&bh)
{
if (!blurcall.amount_complete(max-(bw+bh),max)) {
Expand Down
1 change: 1 addition & 0 deletions synfig-core/src/synfig/blur/gaussian.h
Expand Up @@ -62,6 +62,7 @@ typename T::pointer SC3)
typename T::value_type Tmp1,Tmp2,SR0,SR1,SR2,SR3;

// Setup the row buffers
SC0[0] = SC0[1] = typename T::value_type();
for(x=0;x<w;x++)SC0[x+2]=(pen.x()[x])*24;
memset((void *)SC1,0,(w+2)*sizeof(typename T::value_type));
memset((void *)SC2,0,(w+2)*sizeof(typename T::value_type));
Expand Down

0 comments on commit 41389cf

Please sign in to comment.