[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/scene
Jens-Michael Hoffmann
jensmh at gmx.de
Fri Jul 10 17:37:10 CEST 2009
SVN commit 994456 by jmhoffmann:
- Remove redundant assignment to start iterator,
- cache end iterator.
M +9 -5 GeoSceneGroup.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneGroup.cpp #994455:994456
@@ -41,7 +41,8 @@
bool GeoSceneGroup::propertyAvailable( const QString& name, bool& available )
{
QVector<GeoSceneProperty*>::const_iterator it = m_properties.constBegin();
- for (it = m_properties.constBegin(); it != m_properties.constEnd(); ++it) {
+ QVector<GeoSceneProperty*>::const_iterator end = m_properties.constEnd();
+ for (; it != end; ++it) {
if ( (*it)->name() == name ) {
available = (*it)->available();
return true;
@@ -56,7 +57,8 @@
bool GeoSceneGroup::setPropertyValue( const QString& name, bool value )
{
QVector<GeoSceneProperty*>::const_iterator it = m_properties.constBegin();
- for (it = m_properties.constBegin(); it != m_properties.constEnd(); ++it) {
+ QVector<GeoSceneProperty*>::const_iterator end = m_properties.constEnd();
+ for (; it != end; ++it) {
if ( (*it)->name() == name ) {
(*it)->setValue( value );
return true;
@@ -69,7 +71,8 @@
bool GeoSceneGroup::propertyValue( const QString& name, bool& value )
{
QVector<GeoSceneProperty*>::const_iterator it = m_properties.constBegin();
- for (it = m_properties.constBegin(); it != m_properties.constEnd(); ++it) {
+ QVector<GeoSceneProperty*>::const_iterator end = m_properties.constEnd();
+ for (; it != end; ++it) {
if ( (*it)->name() == name ) {
value = (*it)->value();
return true;
@@ -94,7 +97,7 @@
else {
++it;
}
- }
+ }
if ( property ) {
m_properties.append( property );
@@ -111,7 +114,8 @@
GeoSceneProperty* property = 0;
QVector<GeoSceneProperty*>::const_iterator it = m_properties.constBegin();
- for (it = m_properties.constBegin(); it != m_properties.constEnd(); ++it) {
+ QVector<GeoSceneProperty*>::const_iterator end = m_properties.constEnd();
+ for (; it != end; ++it) {
if ( (*it)->name() == name )
property = *it;
}
More information about the Marble-commits
mailing list