Skip to content

Commit

Permalink
Merge pull request #19705 from ianna/dd-modernize-loop-convert
Browse files Browse the repository at this point in the history
Detector Description Clang Check modernize-loop-convert
  • Loading branch information
cmsbuild committed Jul 12, 2017
2 parents a4d9a53 + 2995e11 commit 3207f44
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions DetectorDescription/Core/src/DDFilteredView.cc
Expand Up @@ -243,8 +243,8 @@ void DDFilteredView::print() {
<< "-------------------" << std::endl
<< "scope = " << epv_.scope_ << std::endl
<< "parents:" << std::endl;
for (unsigned int i=0; i<parents_.size(); ++i)
edm::LogInfo("DDFliteredView") << " " << parents_[i] << std::endl;
for (const auto & parent : parents_)
edm::LogInfo("DDFliteredView") << " " << parent << std::endl;

}

Expand Down
3 changes: 1 addition & 2 deletions DetectorDescription/Core/src/DDLogicalPart.cc
Expand Up @@ -348,8 +348,7 @@ DDIsValid( const std::string & ns, const std::string & nm, std::vector<DDLogical
for (LPNAMES::value_type::const_iterator it=bn; it != ed; ++it)
if(aRegex.match(it->first)) candidates.push_back(it);
}
for (int i=0; i<int(candidates.size()); ++i) {
LPNAMES::value_type::const_iterator it = candidates[i];
for (const auto & it : candidates) {
//if (doit) edm::LogInfo("DDLogicalPart") << "rgx: " << aName << ' ' << it->first << ' ' << doit << std::endl;
std::vector<DDName>::size_type sz = it->second.size(); // no of 'compatible' namespaces
if ( emptyNs && (sz==1) ) { // accept all logical parts in all the namespaces
Expand Down
4 changes: 2 additions & 2 deletions DetectorDescription/Core/src/DDsvalues.cc
Expand Up @@ -56,8 +56,8 @@ std::ostream & operator<<(std::ostream & os , const DDsvalues_type & s)

std::ostream & operator<<(std::ostream & os , const std::vector<const DDsvalues_type*> & v)
{
for (unsigned int i=0; i<v.size() ; ++i) {
os << *(v[i]); // << std::endl;
for (const auto & i : v) {
os << *i; // << std::endl;
}

return os;
Expand Down
7 changes: 3 additions & 4 deletions DetectorDescription/Parser/src/DDXMLElement.cc
Expand Up @@ -219,11 +219,10 @@ void
DDXMLElement::stream( std::ostream & os ) const
{
os << "Output of current element attributes:" << std::endl;
for (std::vector<DDXMLAttribute>::const_iterator itv = attributes_.begin();
itv != attributes_.end(); ++itv)
for (const auto & attribute : attributes_)
{
for (DDXMLAttribute::const_iterator it = itv->begin();
it != itv->end(); ++it)
for (DDXMLAttribute::const_iterator it = attribute.begin();
it != attribute.end(); ++it)
os << it->first << " = " << it->second << "\t";
os << std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions DetectorDescription/Parser/src/FIPConfiguration.cc
Expand Up @@ -49,8 +49,8 @@ FIPConfiguration::dumpFileList(void) const
{
std::cout << "File List:" << std::endl;
std::cout << " number of files=" << files_.size() << std::endl;
for (std::vector<std::string>::const_iterator it = files_.begin(); it != files_.end(); ++it)
std::cout << *it << std::endl;
for (const auto & file : files_)
std::cout << file << std::endl;
}

//-----------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions DetectorDescription/RegressionTest/test/const_dump.cpp
Expand Up @@ -75,8 +75,8 @@ int main(int argc, char *argv[])
std::cout << vit->toString() << std::endl;
const std::vector<double>& tv = *vit;
std::cout << "size: " << tv.size() << std::endl;
for (size_t i=0; i < tv.size(); ++i) {
std::cout << tv[i] << "\t";
for (double i : tv) {
std::cout << i << "\t";
}
std::cout << std::endl;
}
Expand Down
12 changes: 6 additions & 6 deletions DetectorDescription/RegressionTest/test/tutorial.cc
Expand Up @@ -50,7 +50,7 @@ namespace {

bool accept(const DDExpandedView &cv ) const final {
bool returnValue = true;
for(auto f: filters_) {
for(const auto & f : filters_) {
returnValue = returnValue and f->accept(cv);
if(not returnValue) {
break;
Expand Down Expand Up @@ -504,19 +504,19 @@ void tutorial()
case 's':
fv.print();
std::cout << std::endl <<"specifics sets = " << v.size() << ":" << std::endl;
for (spectype::size_type o=0;o<v.size();++o) {
std::cout << *(v[o].first)
for (const auto & o : v) {
std::cout << *(o.first)
<< " = "
<< *(v[o].second)
<< *(o.second)
<< std::endl;// << std::endl;
}
std::cout << std::endl;
std::cout << "merged-specifics:" << std::endl;
std::cout << merged << std::endl;

std::cout << "specifics only at logicalPart:" << std::endl;
for (std::vector<const DDsvalues_type *>::size_type o=0;o<only.size();++o) {
std::cout << *(only[o]) << std::endl;
for (const auto & o : only) {
std::cout << *o << std::endl;
}
std::cout << std::endl;
std::cout << "translation: " << fv.translation() << std::endl;
Expand Down

0 comments on commit 3207f44

Please sign in to comment.