C++11: Favor auto, range for. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-08-16 11:44:06 -04:00
parent 034737d2a8
commit ee9d6dd63f
77 changed files with 371 additions and 505 deletions
+3 -3
View File
@@ -481,9 +481,9 @@ string AstVar::vlPropDecl(string propName) const {
out += "static const int " + propName + "__ulims[";
out += cvtToStr(ulims.size());
out += "] = {";
std::vector<int>::const_iterator it = ulims.begin();
auto it = ulims.cbegin();
out += cvtToStr(*it);
while (++it != ulims.end()) {
while (++it != ulims.cend()) {
out += ", ";
out += cvtToStr(*it);
}
@@ -920,7 +920,7 @@ AstBasicDType* AstTypeTable::findInsertSameDType(AstBasicDType* nodep) {
VBasicTypeKey key(nodep->width(), nodep->widthMin(), nodep->numeric(), nodep->keyword(),
nodep->nrange());
DetailedMap& mapr = m_detailedMap;
DetailedMap::const_iterator it = mapr.find(key);
const auto it = mapr.find(key);
if (it != mapr.end()) return it->second;
mapr.insert(make_pair(key, nodep));
nodep->generic(true);