diff --git a/include/Template.h b/include/Template.h index ec03238c99..8ad0d9051e 100644 --- a/include/Template.h +++ b/include/Template.h @@ -512,11 +512,11 @@ private: multimap::const_iterator i; - int j; + int j = 0; index = attributes.equal_range(name); - for (i = index.first, j = 0 ; i != index.second ; i++, j++) + for (i = index.first; i != index.second ; i++) { const T * vatt = dynamic_cast(i->second); @@ -526,6 +526,7 @@ private: } values.push_back(vatt); + j++; } return j; @@ -540,11 +541,11 @@ private: multimap::iterator i; - int j; + int j = 0; index = attributes.equal_range(name); - for (i = index.first, j = 0 ; i != index.second ; i++, j++) + for (i = index.first; i != index.second ; i++) { T * vatt = dynamic_cast(i->second); @@ -554,6 +555,7 @@ private: } values.push_back(vatt); + j++; } return j;