Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class G4PhysicsTable : public std::vector<G4PhysicsVector*> {
- ....
- };
- typedef G4PhysicsTable::iterator G4PhysicsTableIterator;
- inline void G4PhysicsTable::insertAt(
- size_t idx, G4PhysicsVector* pvec)
- {
- G4PhysicsTableIterator itr=begin();
- for (size_t i=0; i<idx; ++i) { itr++; }
- ....
- }
- This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
- Warning message is:
- V803 Decreased performance. In case 'itr' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. g4physicstable.icc 83
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement