rgw_iam_policy.h implements the andible, orrible, and shortible methods
which called forward on functor objects called in a loop. This does not
have any effect currently since the callers do not pass stateful
functors. However, in case a stateful functor that is also an rvalue is
used, the forward would cause it to lose its state.
Signed-off-by: Vedansh Bhartia <vedanshbhartia@gmail.com>
for (auto itr = it.first; itr != it.second; itr++) {
bool matched = false;
for (const auto& d : v) {
- if (std::forward<F>(f)(itr->second, d)) {
+ if (f(itr->second, d)) {
matched = true;
}
}
const std::vector<std::string>& v) {
for (auto itr = it.first; itr != it.second; itr++) {
for (const auto& d : v) {
- if (std::forward<F>(f)(itr->second, d)) {
+ if (f(itr->second, d)) {
return true;
}
}
}
for (const auto& d : v) {
- auto xd = std::forward<X>(x)(d);
+ auto xd = x(d);
if (!xd) {
- continue;
+ continue;
}
- if (std::forward<F>(f)(*xc, *xd)) {
- return true;
+ if (f(*xc, *xd)) {
+ return true;
}
}
return false;