Skip to content

Commit 4ed1ac6

Browse files
trop[bot]ckerr
andauthored
refactor: simplify Invoker::IsOK() (#45819)
* refactor: simplify Invoker::IsOK() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: might as well make it [[nodiscard]] as well Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
1 parent 289a186 commit 4ed1ac6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

shell/common/gin_helper/function_template.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ class Invoker<std::index_sequence<indices...>, ArgTypes...>
262262
: ArgumentHolder<indices, ArgTypes>(args, invoker_options)...,
263263
args_(args) {}
264264

265-
bool IsOK() { return And(ArgumentHolder<indices, ArgTypes>::ok...); }
265+
[[nodiscard]] bool IsOK() const {
266+
return (... && ArgumentHolder<indices, ArgTypes>::ok);
267+
}
266268

267269
template <typename ReturnType>
268270
void DispatchToCallback(
@@ -285,12 +287,6 @@ class Invoker<std::index_sequence<indices...>, ArgTypes...>
285287
}
286288

287289
private:
288-
static bool And() { return true; }
289-
template <typename... T>
290-
static bool And(bool arg1, T... args) {
291-
return arg1 && And(args...);
292-
}
293-
294290
raw_ptr<gin::Arguments> args_;
295291
};
296292

0 commit comments

Comments
 (0)