aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-expr.h
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2021-02-07 12:40:19 +0800
committerSimplyTheOther <simplytheother@gmail.com>2021-02-07 12:40:19 +0800
commit94be91d6159101caa7c560b188bd6c02d8d86d17 (patch)
treeb3c32de54db1a850079f79d3dfb4c4000dec9d90 /gcc/rust/ast/rust-expr.h
parent27eef5b7a065e8ea05ac575c4b364bb5dbc44e46 (diff)
parentdb7134353447921136a321b8fd78cea78f2c344e (diff)
downloadgcc-94be91d6159101caa7c560b188bd6c02d8d86d17.zip
gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.gz
gcc-94be91d6159101caa7c560b188bd6c02d8d86d17.tar.bz2
Merge branch 'master' of https://github.com/redbrain/gccrs
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 74a6473..511c30d 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -2399,9 +2399,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;
}
}
@@ -2504,6 +2504,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
{