changed: avoid lambda capture

clang warns it's not necessary to use a capture for this.
i opted to make it constexpr and avoid the capture with gcc as well.
This commit is contained in:
Arne Morten Kvarving 2022-06-27 14:47:56 +02:00
parent 9751b78992
commit 133856b943

View File

@ -2390,14 +2390,14 @@ guideRateUpdateIsNeeded(const int reportStepIdx) const {
});
if (!need_update && this->report_step_starts_) {
const auto& events = this->schedule()[reportStepIdx].wellgroup_events();
const auto effective_events_mask = ScheduleEvents::WELL_STATUS_CHANGE
constexpr auto effective_events_mask = ScheduleEvents::WELL_STATUS_CHANGE
+ ScheduleEvents::INJECTION_TYPE_CHANGED
+ ScheduleEvents::WELL_SWITCHED_INJECTOR_PRODUCER
+ ScheduleEvents::NEW_WELL;
need_update = std::any_of(this->well_container_generic_.begin(),
this->well_container_generic_.end(),
[&events, effective_events_mask](const WellInterfaceGeneric* well)
[&events](const WellInterfaceGeneric* well)
{
return events.hasEvent(well->name(), effective_events_mask);
});