diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-27 22:35:05 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-27 22:35:05 -0500 |
commit | ae2721f2c84183cea4e447009a59ce606601702e (patch) | |
tree | c9a99296ca8cdec998568eb62c102005367e304d | |
parent | 08d259cf41db805ada7c39a39ffe9dcec4f0c230 (diff) | |
download | minetest-ae2721f2c84183cea4e447009a59ce606601702e.tar.gz minetest-ae2721f2c84183cea4e447009a59ce606601702e.tar.bz2 minetest-ae2721f2c84183cea4e447009a59ce606601702e.zip |
VoxelManipulator: Remove unnecessary deallocation steps
-rw-r--r-- | src/voxel.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/voxel.cpp b/src/voxel.cpp index bd14acb06..1299a5296 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -46,21 +46,15 @@ VoxelManipulator::VoxelManipulator(): VoxelManipulator::~VoxelManipulator() { clear(); - if(m_data) - delete[] m_data; - if(m_flags) - delete[] m_flags; } void VoxelManipulator::clear() { // Reset area to volume=0 m_area = VoxelArea(); - if(m_data) - delete[] m_data; + delete[] m_data; m_data = NULL; - if(m_flags) - delete[] m_flags; + delete[] m_flags; m_flags = NULL; } @@ -215,10 +209,8 @@ void VoxelManipulator::addArea(const VoxelArea &area) m_data = new_data; m_flags = new_flags; - if(old_data) - delete[] old_data; - if(old_flags) - delete[] old_flags; + delete[] old_data; + delete[] old_flags; //dstream<<"addArea done"<<std::endl; } |