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-Tag: 0.4.10~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=56bf867874bda0a5fc4d34415984241a52083b3b;p=oweals%2Fminetest.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 4b523b596..0d8b55163 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