code cleanup: use checks for empty rather then size in the BGE
authorCampbell Barton <ideasman42@gmail.com>
Sun, 7 Oct 2012 12:28:19 +0000 (12:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 7 Oct 2012 12:28:19 +0000 (12:28 +0000)
source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

index 183da9d252ed755b1a1653c59b6b344420486362..c890f0c3dc5597d1286ecfe1a859c9cc6460ebf3 100644 (file)
@@ -147,7 +147,7 @@ void RAS_MeshSlot::begin(RAS_MeshSlot::iterator& it)
        int startvertex, endvertex;
        int startindex, endindex;
 
-       it.array = (m_displayArrays.size() > 0)? m_displayArrays[m_startarray]: NULL;
+       it.array = m_displayArrays.empty() ? NULL : m_displayArrays[m_startarray];
 
        if (it.array == NULL || it.array->m_index.size() == 0 || it.array->m_vertex.size() == 0) {
                it.array = NULL;
@@ -368,7 +368,7 @@ bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance)
        size_t i;
 
        // verify if we can join
-       if (m_joinSlot || m_joinedSlots.size() || target->m_joinSlot)
+       if (m_joinSlot || (m_joinedSlots.empty() == false) || target->m_joinSlot)
                return false;
 
        if (!Equals(target))
@@ -461,7 +461,7 @@ bool RAS_MeshSlot::Split(bool force)
                                abort();
                }
 
-               if (target->m_displayArrays.size()) {
+               if (target->m_displayArrays.empty() == false) {
                        target->m_endvertex = target->m_displayArrays.back()->m_vertex.size();
                        target->m_endindex = target->m_displayArrays.back()->m_index.size();
                }
index 67423123a7a9280145de4036bd0fbaae2f27c0ef..a0da1c79baa94d6dd372d82d92476311a6f02035 100644 (file)
@@ -359,7 +359,7 @@ void RAS_OpenGLRasterizer::ClearCachingInfo(void)
 
 void RAS_OpenGLRasterizer::FlushDebugShapes()
 {
-       if (!m_debugShapes.size())
+       if (m_debugShapes.empty())
                return;
 
        // DrawDebugLines