From 1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 20 Aug 2017 13:30:50 +0200 Subject: Modernize source code: last part (#6285) * Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes --- src/voxel.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/voxel.h') diff --git a/src/voxel.h b/src/voxel.h index 49a75c95f..d03cecd95 100644 --- a/src/voxel.h +++ b/src/voxel.h @@ -59,7 +59,7 @@ class VoxelArea { public: // Starts as zero sized - VoxelArea() {} + VoxelArea() = default; VoxelArea(const v3s16 &min_edge, const v3s16 &max_edge): MinEdge(min_edge), @@ -175,12 +175,12 @@ public: VoxelArea operator+(const v3s16 &off) const { - return VoxelArea(MinEdge+off, MaxEdge+off); + return {MinEdge+off, MaxEdge+off}; } VoxelArea operator-(const v3s16 &off) const { - return VoxelArea(MinEdge-off, MaxEdge-off); + return {MinEdge-off, MaxEdge-off}; } /* @@ -344,7 +344,7 @@ enum VoxelPrintMode class VoxelManipulator { public: - VoxelManipulator(); + VoxelManipulator() = default; virtual ~VoxelManipulator(); /* @@ -374,7 +374,7 @@ public: addArea(voxel_area); if (m_flags[m_area.index(p)] & VOXELFLAG_NO_DATA) { - return MapNode(CONTENT_IGNORE); + return {CONTENT_IGNORE}; } return m_data[m_area.index(p)]; @@ -382,9 +382,9 @@ public: MapNode getNodeNoExNoEmerge(const v3s16 &p) { if (!m_area.contains(p)) - return MapNode(CONTENT_IGNORE); + return {CONTENT_IGNORE}; if (m_flags[m_area.index(p)] & VOXELFLAG_NO_DATA) - return MapNode(CONTENT_IGNORE); + return {CONTENT_IGNORE}; return m_data[m_area.index(p)]; } // Stuff explodes if non-emerged area is touched with this. -- cgit v1.2.3