Changed: Replaced tests with .size() by .empty() because faster

This commit is contained in:
kervala 2014-07-19 14:01:03 +02:00
parent 0e95ce2a25
commit f7d9b32051
4 changed files with 4 additions and 4 deletions

View file

@ -362,7 +362,7 @@ int main()
}
++itAcc;
}
if ((vCluster.size() == 0) && (DispCS[0].pIG == pCurIG))
if (vCluster.empty() && (DispCS[0].pIG == pCurIG))
{
vCluster.push_back (pClipTrav->RootCluster);
}

View file

@ -47,7 +47,7 @@ CConfiguration::~CConfiguration()
void CConfiguration::init()
{
// verify data
nlassert(!m_ConfigCallbacks.size());
nlassert(m_ConfigCallbacks.empty());
// load config
m_ConfigFile.load(NLQT_CONFIG_FILE);

View file

@ -271,7 +271,7 @@ void CFlareModel::traverseRender()
float depthRangeNear, depthRangeFar;
drv->getDepthRange(depthRangeNear, depthRangeFar);
z = (depthRangeFar - depthRangeNear) * z + depthRangeNear;
if (!v.size() || z > v[0]) // test against z-buffer
if (v.empty() || z > v[0]) // test against z-buffer
{
visibilityRatio = 0.f;
}

View file

@ -354,7 +354,7 @@ void CLodCharacterShape::buildMesh(const std::string &name, const CLodCharacte
const vector<CVector> &normals= lodBuild.Normals;
nlassert(numVertices>0);
nlassert(triangleIndices.size()>0);
nlassert(!triangleIndices.empty());
nlassert((triangleIndices.size()%3)==0);
nlassert(skinWeights.size() == numVertices);
nlassert(uvs.size() == numVertices);