From 0bb464411b9ead3ff46093a030c86c320d19d2b7 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 19 Jul 2014 14:01:03 +0200 Subject: [PATCH] Changed: Replaced tests with .size() by .empty() because faster --- code/nel/samples/3d/cluster_viewer/main.cpp | 2 +- code/nel/samples/3d/nel_qt/configuration.cpp | 2 +- code/nel/src/3d/flare_model.cpp | 2 +- code/nel/src/3d/lod_character_shape.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/nel/samples/3d/cluster_viewer/main.cpp b/code/nel/samples/3d/cluster_viewer/main.cpp index 6004e574c..d7956adbe 100644 --- a/code/nel/samples/3d/cluster_viewer/main.cpp +++ b/code/nel/samples/3d/cluster_viewer/main.cpp @@ -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); } diff --git a/code/nel/samples/3d/nel_qt/configuration.cpp b/code/nel/samples/3d/nel_qt/configuration.cpp index f35502a67..9bbe62736 100644 --- a/code/nel/samples/3d/nel_qt/configuration.cpp +++ b/code/nel/samples/3d/nel_qt/configuration.cpp @@ -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); diff --git a/code/nel/src/3d/flare_model.cpp b/code/nel/src/3d/flare_model.cpp index 6c422aac9..f964a9102 100644 --- a/code/nel/src/3d/flare_model.cpp +++ b/code/nel/src/3d/flare_model.cpp @@ -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; } diff --git a/code/nel/src/3d/lod_character_shape.cpp b/code/nel/src/3d/lod_character_shape.cpp index 6250f2fb5..02d15ce03 100644 --- a/code/nel/src/3d/lod_character_shape.cpp +++ b/code/nel/src/3d/lod_character_shape.cpp @@ -354,7 +354,7 @@ void CLodCharacterShape::buildMesh(const std::string &name, const CLodCharacte const vector &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);