diff --git a/init/action.cpp b/init/action.cpp index 1e998aeeb..18f636042 100644 --- a/init/action.cpp +++ b/init/action.cpp @@ -30,7 +30,7 @@ namespace init { Result RunBuiltinFunction(const BuiltinFunction& function, const std::vector& args, const std::string& context) { - auto builtin_arguments = BuiltinArguments(context); + BuiltinArguments builtin_arguments{.context = context}; builtin_arguments.args.resize(args.size()); builtin_arguments.args[0] = args[0]; @@ -69,7 +69,7 @@ Result Command::InvokeFunc(Subcontext* subcontext) const { } Result Command::CheckCommand() const { - auto builtin_arguments = BuiltinArguments("host_init_verifier"); + BuiltinArguments builtin_arguments{.context = "host_init_verifier"}; builtin_arguments.args.resize(args_.size()); builtin_arguments.args[0] = args_[0]; diff --git a/init/builtin_arguments.h b/init/builtin_arguments.h index 1742b78a6..890a21681 100644 --- a/init/builtin_arguments.h +++ b/init/builtin_arguments.h @@ -24,10 +24,6 @@ namespace android { namespace init { struct BuiltinArguments { - BuiltinArguments(const std::string& context) : context(context) {} - BuiltinArguments(std::vector args, const std::string& context) - : args(std::move(args)), context(context) {} - const std::string& operator[](std::size_t i) const { return args[i]; } auto begin() const { return args.begin(); } auto end() const { return args.end(); } diff --git a/init/builtins.cpp b/init/builtins.cpp index a89813e44..bc23972a2 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1074,7 +1074,7 @@ static Result do_restorecon(const BuiltinArguments& args) { static Result do_restorecon_recursive(const BuiltinArguments& args) { std::vector non_const_args(args.args); non_const_args.insert(std::next(non_const_args.begin()), "--recursive"); - return do_restorecon({std::move(non_const_args), args.context}); + return do_restorecon({.args = std::move(non_const_args), .context = args.context}); } static Result do_loglevel(const BuiltinArguments& args) { diff --git a/init/check_builtins.cpp b/init/check_builtins.cpp index 481fa31e5..461ed2255 100644 --- a/init/check_builtins.cpp +++ b/init/check_builtins.cpp @@ -85,7 +85,7 @@ Result check_exec_background(const BuiltinArguments& args) { } Result check_exec_reboot_on_failure(const BuiltinArguments& args) { - BuiltinArguments remaining_args(args.context); + BuiltinArguments remaining_args{.context = args.context}; remaining_args.args = std::vector(args.begin() + 1, args.end()); remaining_args.args[0] = args[0];