Skip to content

Commit ae2721f

Browse files
committedDec 28, 2014
VoxelManipulator: Remove unnecessary deallocation steps
1 parent 08d259c commit ae2721f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed
 

‎src/voxel.cpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,15 @@ VoxelManipulator::VoxelManipulator():
4646
VoxelManipulator::~VoxelManipulator()
4747
{
4848
clear();
49-
if(m_data)
50-
delete[] m_data;
51-
if(m_flags)
52-
delete[] m_flags;
5349
}
5450

5551
void VoxelManipulator::clear()
5652
{
5753
// Reset area to volume=0
5854
m_area = VoxelArea();
59-
if(m_data)
60-
delete[] m_data;
55+
delete[] m_data;
6156
m_data = NULL;
62-
if(m_flags)
63-
delete[] m_flags;
57+
delete[] m_flags;
6458
m_flags = NULL;
6559
}
6660

@@ -215,10 +209,8 @@ void VoxelManipulator::addArea(const VoxelArea &area)
215209
m_data = new_data;
216210
m_flags = new_flags;
217211

218-
if(old_data)
219-
delete[] old_data;
220-
if(old_flags)
221-
delete[] old_flags;
212+
delete[] old_data;
213+
delete[] old_flags;
222214

223215
//dstream<<"addArea done"<<std::endl;
224216
}

0 commit comments

Comments
 (0)
Please sign in to comment.