OSDN Git Service

[NFC] PrintHelp cleanup
authorJan Korous <jkorous@apple.com>
Mon, 12 Mar 2018 18:30:47 +0000 (18:30 +0000)
committerJan Korous <jkorous@apple.com>
Mon, 12 Mar 2018 18:30:47 +0000 (18:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327311 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Option/OptTable.cpp

index 5956764..658129b 100644 (file)
@@ -540,9 +540,7 @@ void OptTable::PrintHelp(raw_ostream &OS, const char *Name, const char *Title,
   using helpmap_ty = std::map<std::string, std::vector<OptionInfo>>;
   helpmap_ty GroupedOptionHelp;
 
-  for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
-    unsigned Id = i + 1;
-
+  for (unsigned Id = 1, e = getNumOptions() + 1; Id != e; ++Id) {
     // FIXME: Split out option groups.
     if (getOptionKind(Id) == Option::GroupClass)
       continue;