Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instances call should not be wrapped in select_many when iterating over it with foreach. #457

Open
doczir opened this issue Oct 22, 2015 · 0 comments

Comments

@doczir
Copy link
Contributor

doczir commented Oct 22, 2015

If the instances call is part of a foreach, it is not necessary to call select_many on it, as it will only wrap the elements in a set and then get thrown away without making a significant difference in semantics, since the instances list is already unique (but not sorted!). The following code shows an example of this:

rALF:

for(FallBackTimer __timer in FallBackTimer::instances()) {
  FallBackTimer timer = __timer;
}

generated C++:

for(::eatf::ComponentsLibrary::EATF::eatfImplPkg::FallBackTimer* __ralf__0____timer : ::xumlrt::select_many(::eatf::ComponentsLibrary::EATF::eatfImplPkg::FallBackTimer::_instances)) {
  ::eatf::ComponentsLibrary::EATF::eatfImplPkg::FallBackTimer* __ralf__1__0__timer = __ralf__0____timer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants