Refactoring: replace a bunch of static array size computation or hardcoded constant
with a template function 'arraysize(static_array)', defined in Utils.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139444 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index 5f540d6..4557883 100644
--- a/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -15,6 +15,7 @@
// Project includes
#include "lldb/Target/Target.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/Utils.h"
using namespace lldb;
using namespace lldb_private;
@@ -45,12 +46,10 @@
{ 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL }
};
-const uint32_t k_num_file_options = sizeof(g_option_table)/sizeof(OptionDefinition);
-
uint32_t
OptionGroupValueObjectDisplay::GetNumDefinitions ()
{
- return k_num_file_options;
+ return arraysize(g_option_table);
}
const OptionDefinition *