Fix cppcheck performance warning : Prefer prefix ++/-- operators for non-primitive types.

This commit is contained in:
Frederic Bouvier
2011-01-28 13:47:26 +01:00
parent 1035e714ff
commit 29c8c9f989
5 changed files with 7 additions and 7 deletions

View File

@@ -192,7 +192,7 @@ SGEnviro::~SGEnviro(void) {
// OSGFIXME
return;
list_of_lightning::iterator iLightning;
for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; iLightning++ ) {
for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; ++iLightning ) {
delete (*iLightning);
}
lightnings.clear();

View File

@@ -2090,7 +2090,7 @@ public:
virtual bool buttonPressed(int button, const Info&)
{
bool found = false;
for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); it++ ) {
for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); ++it ) {
if( *it == button ) {
found = true;
break;

View File

@@ -546,7 +546,7 @@ void SGShadowVolume::SceneryObject::computeShadows(void) {
sgSetVec4( rotation[3], 0, 0, 0, 1);
ShadowCaster_list::iterator iShadowCaster;
for(iShadowCaster = parts.begin() ; iShadowCaster != parts.end() ; iShadowCaster ++ ) {
for(iShadowCaster = parts.begin() ; iShadowCaster != parts.end() ; ++iShadowCaster ) {
(*iShadowCaster)->computeShadows(rotation, rotation_translation, occluder_type);
}
}
@@ -720,7 +720,7 @@ SGShadowVolume::SceneryObject::SceneryObject(ssgBranch *_scenery_object, Occlude
SGShadowVolume::SceneryObject::~SceneryObject()
{
ShadowCaster_list::iterator iParts;
for(iParts = parts.begin() ; iParts != parts.end(); iParts++ ) {
for(iParts = parts.begin() ; iParts != parts.end(); ++iParts ) {
delete *iParts;
}
parts.clear();
@@ -864,7 +864,7 @@ SGShadowVolume::SGShadowVolume( ssgBranch *root ) :
SGShadowVolume::~SGShadowVolume() {
SceneryObject_map::iterator iSceneryObject;
for(iSceneryObject = sceneryObjects.begin() ; iSceneryObject != sceneryObjects.end(); iSceneryObject++ ) {
for(iSceneryObject = sceneryObjects.begin() ; iSceneryObject != sceneryObjects.end(); ++iSceneryObject ) {
delete iSceneryObject->second;
}
sceneryObjects.clear();

View File

@@ -74,7 +74,7 @@ SGCommandMgr::getCommandNames () const
command_map::const_iterator last = _commands.end();
while (it != last) {
names.push_back(it->first);
it++;
++it;
}
return names;
}

View File

@@ -84,7 +84,7 @@ SGSubsystem::printTimingInformation ()
SGTimeStamp startTime;
for ( eventTimeVecIterator i = timingInfo.begin();
i != timingInfo.end();
i++) {
++i) {
if (i == timingInfo.begin()) {
startTime = i->getTime();
} else {