From 56bf867874bda0a5fc4d34415984241a52083b3b Mon Sep 17 00:00:00 2001 From: sapier Date: Sat, 7 Jun 2014 02:52:58 +0200 Subject: [PATCH] Use memset for flag initialization (compiler optimization is way better) use temp variables instead of recalculating array index --- src/voxel.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/voxel.cpp b/src/voxel.cpp index 4b523b59..0d8b5516 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -183,11 +183,10 @@ void VoxelManipulator::addArea(VoxelArea area) // Allocate and clear new data MapNode *new_data = new MapNode[new_size]; + assert(new_data); u8 *new_flags = new u8[new_size]; - for(s32 i=0; i