From: sapier Date: Sat, 7 Jun 2014 00:52:58 +0000 (+0200) Subject: Use memset for flag initialization (compiler optimization is way better) X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=56bf867874bda0a5fc4d34415984241a52083b3b;p=zefram%2Fminetest%2Fminetest_engine.git Use memset for flag initialization (compiler optimization is way better) use temp variables instead of recalculating array index --- 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