From 989918a59c51c27dbda3d871afefeaeb0911e90b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 26 Feb 2025 18:50:57 -0600 Subject: [PATCH] refactor: simplify Invoker::IsOK() (#45803) * refactor: simplify Invoker::IsOK() * refactor: might as well make it [[nodiscard]] as well --- shell/common/gin_helper/function_template.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/shell/common/gin_helper/function_template.h b/shell/common/gin_helper/function_template.h index 5633184bec60..2889d17beaea 100644 --- a/shell/common/gin_helper/function_template.h +++ b/shell/common/gin_helper/function_template.h @@ -262,7 +262,9 @@ class Invoker, ArgTypes...> : ArgumentHolder(args, invoker_options)..., args_(args) {} - bool IsOK() { return And(ArgumentHolder::ok...); } + [[nodiscard]] bool IsOK() const { + return (... && ArgumentHolder::ok); + } template void DispatchToCallback( @@ -285,12 +287,6 @@ class Invoker, ArgTypes...> } private: - static bool And() { return true; } - template - static bool And(bool arg1, T... args) { - return arg1 && And(args...); - } - raw_ptr args_; };