aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r--gcc/rust/ast/rust-expr.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 6dba7fd..50006d1 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -2355,9 +2355,9 @@ public:
void iterate_params (std::function<bool (Expr *)> cb)
{
- for (auto it = params.begin (); it != params.end (); it++)
+ for (auto &param : params)
{
- if (!cb (it->get ()))
+ if (!cb (param.get ()))
return;
}
}
@@ -2456,6 +2456,15 @@ public:
void mark_for_strip () override { receiver = nullptr; }
bool is_marked_for_strip () const override { return receiver == nullptr; }
+ void iterate_params (std::function<bool (Expr *)> cb)
+ {
+ for (auto &param : params)
+ {
+ if (!cb (param.get ()))
+ return;
+ }
+ }
+
// TODO: this mutable getter seems really dodgy. Think up better way.
const std::vector<std::unique_ptr<Expr> > &get_params () const
{