diff options
author | Tom Cherry <tomcherry@google.com> | 2019-07-22 16:05:36 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2019-07-23 14:39:38 -0700 |
commit | d52a5b3c10ad341e38f61466e81b7a963e6eb92e (patch) | |
tree | 4a39211c457d181b091a854d8faeedb1be7170c5 /init/builtins.cpp | |
parent | b3fc1b7441b8cc4d11384cf8867682308daffb15 (diff) |
init: simplify keyword_map
I've heard that keyword_map is too complex, in particular the tuple
and the pair in BuiltinFunctionMap, so this change removes a lot of
that complexity and, more importantly, better documents how all of
this works.
Test: boot, init unit tests
Change-Id: I74e5f9de7f2ec524cb6127bb9da2956b5f307f56
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index ceab56877..b6e26a120 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1152,10 +1152,10 @@ static Result<void> do_enter_default_mount_ns(const BuiltinArguments& args) { } // Builtin-function-map start -const BuiltinFunctionMap::Map& BuiltinFunctionMap::map() const { +const BuiltinFunctionMap& GetBuiltinFunctionMap() { constexpr std::size_t kMax = std::numeric_limits<std::size_t>::max(); // clang-format off - static const Map builtin_functions = { + static const BuiltinFunctionMap builtin_functions = { {"bootchart", {1, 1, {false, do_bootchart}}}, {"chmod", {2, 2, {true, do_chmod}}}, {"chown", {2, 3, {true, do_chown}}}, |