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

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

View file

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

View file

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

View file

@ -271,7 +271,7 @@ void CFlareModel::traverseRender()
float depthRangeNear, depthRangeFar; float depthRangeNear, depthRangeFar;
drv->getDepthRange(depthRangeNear, depthRangeFar); drv->getDepthRange(depthRangeNear, depthRangeFar);
z = (depthRangeFar - depthRangeNear) * z + depthRangeNear; 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; visibilityRatio = 0.f;
} }

View file

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