From c65034eb2ce899c5c0acac0c05ce118040cd753e Mon Sep 17 00:00:00 2001
From: Philippe Canal <pcanal@fnal.gov>
Date: Fri, 15 Nov 2013 05:55:00 -0600
Subject: [PATCH] Don't have the inner loop inadvertently increment the outer
 loop iterator

---
 html/src/TDocOutput.cxx | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/html/src/TDocOutput.cxx b/html/src/TDocOutput.cxx
index d6f4f8b8e6c..dbeaa860e7f 100644
--- a/html/src/TDocOutput.cxx
+++ b/html/src/TDocOutput.cxx
@@ -1013,25 +1013,21 @@ void TDocOutput::CreateModuleIndex()
          Bool_t already_indirect = kFALSE;
          for (std::set<std::string>::const_iterator iDep2 = deps.begin();
               !already_indirect && iDep2 != deps.end(); ++iDep2) {
-            if (iDep == iDep2) {
-               ++iDep;
-               continue;
-            }
+            if (iDep == iDep2) continue;
             TLibraryDocInfo* libinfo2 = (TLibraryDocInfo*)
                fHtml->GetLibraryDependencies()->FindObject(iDep2->c_str());
-            if (!libinfo2) {
-               ++iDep;
-               continue;
-            }
+            if (!libinfo2) continue;
             const std::set<std::string>& deps2 = libinfo2->GetDependencies();
             already_indirect |= deps2.find(*iDep) != deps2.end();
          }
          if (already_indirect) {
             std::set<std::string>::iterator iRemove = iDep;
-            // Advance the iterator before erasing the element which invalidate the iterator.
+            // Advance the iterator before erasing the element which invalidates the iterator.
             ++iDep;
             deps.erase(iRemove);
-         } else ++iDep;
+         } else {
+            ++iDep;
+         }
       } // for library dependencies of module in library
    } // for libaries
 
-- 
GitLab