Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
llvm-svn: 186300
diff --git a/clang/lib/AST/CommentCommandTraits.cpp b/clang/lib/AST/CommentCommandTraits.cpp
index 6baf4a9..01bd12e 100644
--- a/clang/lib/AST/CommentCommandTraits.cpp
+++ b/clang/lib/AST/CommentCommandTraits.cpp
@@ -75,7 +75,7 @@
SmallVector<const CommandInfo *, 2> BestCommand;
- int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo);
+ const int NumOfCommands = llvm::array_lengthof(Commands);
for (int i = 0; i < NumOfCommands; i++)
HelperTypoCorrectCommandInfo(BestCommand, Typo, &Commands[i]);