From 05a1f8928646e39cb895f9b24f5de16b6bd97f3a Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 8 May 2012 09:25:15 +0000 Subject: Fixed two "bottlenecks" found using profiling - MakeIndex() instead of MakeIndexNoCheck() git-svn-id: http://mc-server.googlecode.com/svn/trunk@483 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 597568a76..7b3d20911 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -596,7 +596,7 @@ void cChunk::CreateBlockEntities(void) { for (int y = 0; y < Height; y++) { - ENUM_BLOCK_ID BlockType = (ENUM_BLOCK_ID)m_BlockTypes[ MakeIndex( x, y, z ) ]; + ENUM_BLOCK_ID BlockType = (ENUM_BLOCK_ID)m_BlockTypes[ MakeIndexNoCheck( x, y, z ) ]; switch ( BlockType ) { case E_BLOCK_CHEST: @@ -644,7 +644,7 @@ void cChunk::CalculateHeightmap() { for (int y = Height - 1; y > -1; y--) { - int index = MakeIndex( x, y, z ); + int index = MakeIndexNoCheck( x, y, z ); if (m_BlockTypes[index] != E_BLOCK_AIR) { m_HeightMap[x + z * Width] = (unsigned char)y; -- cgit v1.2.3