fixed foreach loops code checker issues

Review Request #108217 - Created Jan. 5, 2013 and submitted

Information
Mohammed Nafees
marble
master
Reviewers
kdeedu, marble
krake
http://www.google-melange.com/gci/task/view/google/gci2012/8159207

fixed Krazy issues on foreach loops
yes

Issues

  • 10
  • 0
  • 0
  • 10
Description From Last Updated
Here it is not clear, if the container of the begin iterator is the same like the container of the ... Jens-Michael Hoffmann Jens-Michael Hoffmann
no, this is a lookup, the iterator has a value() method that returns the value the iterator points to Kevin Krammer Kevin Krammer
const_iterator, constEnd Kevin Krammer Kevin Krammer
no, this is an unneeded lookup itpoint.value() does the same more efficiently Kevin Krammer Kevin Krammer
unneeded lookup overhead, use itpoint.value() instead Kevin Krammer Kevin Krammer
unneeded lookup overhead, use itpoint.value() instead Kevin Krammer Kevin Krammer
unneeded lookup overhead, use itpoint.value() instead Kevin Krammer Kevin Krammer
unneeded lookup overhead, use itpoint.value() instead Kevin Krammer Kevin Krammer
unneeded lookup overhead, use itpoint.value() instead Kevin Krammer Kevin Krammer
unneeded lookup overhead at expected->settings().value(), use itpoint.value() instead Kevin Krammer Kevin Krammer
Akarsh Simha
Jens-Michael Hoffmann
Mohammed Nafees
Jens-Michael Hoffmann
Jens-Michael Hoffmann
Jens-Michael Hoffmann
Commit Hook
Mohammed Nafees
Review request changed

Status: Closed (submitted)

Kevin Krammer
Consider this review more as a hint for how to handle this in applications where the developers care about performance of such loops.
Obviously the developers here are fine with incurring lookups on each iteration otherwise they would not have used foreach on keys() or values() in the first place
src/lib/FileManager.cpp (Diff revision 4)
 
 
const_iterator, constBegin
src/lib/FileManager.cpp (Diff revision 4)
 
 
const_iterator, constBegin
src/lib/FileManager.cpp (Diff revision 4)
 
 
no, this is a lookup, the iterator has a value() method that returns the value the iterator points to
src/lib/StackedTileLoader.cpp (Diff revision 4)
 
 
const_iterator, constBegin
src/lib/StackedTileLoader.cpp (Diff revision 4)
 
 
const_iterator, constEnd
src/lib/routing/RouteAnnotator.cpp (Diff revision 4)
 
 
const_iterator, constBegin
src/lib/routing/RouteAnnotator.cpp (Diff revision 4)
 
 
const_iterator, constEnd
src/lib/routing/RouteAnnotator.cpp (Diff revision 4)
 
 
no, this is an unneeded lookup
itpoint.value() does the same more efficiently
const_iterator, constBegin
const_iterator, constEnd
unneeded lookup overhead, use itpoint.value() instead
unneeded lookup overhead, use itpoint.value() instead
unneeded lookup overhead, use itpoint.value() instead
unneeded lookup overhead, use itpoint.value() instead
unneeded lookup overhead, use itpoint.value() instead
tests/RenderPluginTest.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tests/RenderPluginTest.cpp (Diff revision 4)
 
 
const_iterator, constEnd
tests/RenderPluginTest.cpp (Diff revision 4)
 
 
unneeded lookup overhead at expected->settings().value(), use itpoint.value() instead
tests/TestGeoDataWriter.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tests/TestGeoDataWriter.cpp (Diff revision 4)
 
 
const_iterator, constEnd
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constEnd
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constEnd
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tests/TestGeoSceneWriter.cpp (Diff revision 4)
 
 
const_iterator, constEnd
tools/osm-addresses/OsmParser.cpp (Diff revision 4)
 
 
const_iterator, constBegin
tools/osm-addresses/OsmParser.cpp (Diff revision 4)
 
 
const_iterator, constEnd
Loading...