Core: Do not use STL container size method to check if container is empty

This commit is contained in:
Spp-
2011-07-01 14:58:44 +02:00
parent ce75ced741
commit bb921ae78c
17 changed files with 34 additions and 30 deletions
@@ -86,7 +86,7 @@ class BIH
template< class T, class BoundsFunc >
void build(const std::vector<T> &primitives, BoundsFunc &getBounds, uint32 leafSize = 3, bool printStats=false)
{
if(primitives.size() == 0)
if(primitives.empty())
return;
buildData dat;
dat.maxPrims = leafSize;
+4 -4
View File
@@ -360,7 +360,7 @@ namespace VMAP
bool GroupModel::IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const
{
if (!triangles.size())
if (triangles.empty())
return false;
GModelRayCallback callback(triangles, vertices);
meshTree.intersectRay(ray, callback, distance, stopAtFirstHit);
@@ -369,7 +369,7 @@ namespace VMAP
bool GroupModel::IsInsideObject(const Vector3 &pos, const Vector3 &down, float &z_dist) const
{
if (!triangles.size() || !iBound.contains(pos))
if (triangles.empty() || !iBound.contains(pos))
return false;
GModelRayCallback callback(triangles, vertices);
Vector3 rPos = pos - 0.1f * down;
@@ -468,7 +468,7 @@ namespace VMAP
bool WorldModel::IntersectPoint(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, AreaInfo &info) const
{
if (!groupModels.size())
if (groupModels.empty())
return false;
WModelAreaCallback callback(groupModels, down);
groupTree.intersectPoint(p, callback);
@@ -486,7 +486,7 @@ namespace VMAP
bool WorldModel::GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, LocationInfo &info) const
{
if (!groupModels.size())
if (groupModels.empty())
return false;
WModelAreaCallback callback(groupModels, down);
groupTree.intersectPoint(p, callback);