From e240cab5239084301e2fd5273a208c2877d6957a Mon Sep 17 00:00:00 2001 From: Woazboat Date: Mon, 27 Apr 2015 21:54:36 +0200 Subject: Removed redundant temp iterator. std::list.erase already returns iterator to next valid list element --- src/SetChunkData.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/SetChunkData.cpp') diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index f2b58570d..e5afd96ed 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -131,11 +131,8 @@ void cSetChunkData::RemoveInvalidBlockEntities(void) ItemTypeToString(EntityBlockType).c_str(), EntityBlockType, ItemTypeToString(WorldBlockType).c_str(), WorldBlockType ); - cBlockEntityList::iterator itr2 = itr; - ++itr2; delete *itr; - m_BlockEntities.erase(itr); - itr = itr2; + itr = m_BlockEntities.erase(itr); } else { -- cgit v1.2.3 From 4e8b4981d877b28e0784f294341072fa3f279fb4 Mon Sep 17 00:00:00 2001 From: Woazboat Date: Tue, 28 Apr 2015 02:26:25 +0200 Subject: convert c style casts to c++ static casts --- src/SetChunkData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SetChunkData.cpp') diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index e5afd96ed..7549b0dbf 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -103,7 +103,7 @@ void cSetChunkData::CalculateHeightMap(void) int index = cChunkDef::MakeIndexNoCheck(x, y, z); if (m_BlockTypes[index] != E_BLOCK_AIR) { - m_HeightMap[x + z * cChunkDef::Width] = (HEIGHTTYPE)y; + m_HeightMap[x + z * cChunkDef::Width] = static_cast(y); break; } } // for y -- cgit v1.2.3