| Message ID | 20251103140049.413881-1-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Accepted |
| Headers | show |
| Series |
|
| Related | show |
Hi Barnabas On 03/11/2025 14:00, Barnabás Pőcze wrote: > `constraintModes()` and `exposureModeHelpers()` need not return copies of > the internal objects, exposing const references is sufficient, so do that. > > Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Wrong tag :) Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> > --- > src/ipa/libipa/agc_mean_luminance.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h > index d7ec548e3e..e5f164c318 100644 > --- a/src/ipa/libipa/agc_mean_luminance.h > +++ b/src/ipa/libipa/agc_mean_luminance.h > @@ -53,12 +53,12 @@ public: > void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, > double minGain, double maxGain, std::vector<AgcConstraint> constraints); > > - std::map<int32_t, std::vector<AgcConstraint>> constraintModes() > + const std::map<int32_t, std::vector<AgcConstraint>> &constraintModes() const > { > return constraintModes_; > } > > - std::map<int32_t, std::shared_ptr<ExposureModeHelper>> exposureModeHelpers() > + const std::map<int32_t, std::shared_ptr<ExposureModeHelper>> &exposureModeHelpers() const > { > return exposureModeHelpers_; > }
2025. 11. 03. 15:02 keltezéssel, Dan Scally írta: > Hi Barnabas > > On 03/11/2025 14:00, Barnabás Pőcze wrote: >> `constraintModes()` and `exposureModeHelpers()` need not return copies of >> the internal objects, exposing const references is sufficient, so do that. >> >> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > Wrong tag :) Yes :( I have multiple tags pinned in the clipboard manager... I was wondering how long I can avoid such a mixup. Seems like that day is today. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> > >> --- >> src/ipa/libipa/agc_mean_luminance.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h >> index d7ec548e3e..e5f164c318 100644 >> --- a/src/ipa/libipa/agc_mean_luminance.h >> +++ b/src/ipa/libipa/agc_mean_luminance.h >> @@ -53,12 +53,12 @@ public: >> void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, >> double minGain, double maxGain, std::vector<AgcConstraint> constraints); >> - std::map<int32_t, std::vector<AgcConstraint>> constraintModes() >> + const std::map<int32_t, std::vector<AgcConstraint>> &constraintModes() const >> { >> return constraintModes_; >> } >> - std::map<int32_t, std::shared_ptr<ExposureModeHelper>> exposureModeHelpers() >> + const std::map<int32_t, std::shared_ptr<ExposureModeHelper>> &exposureModeHelpers() const >> { >> return exposureModeHelpers_; >> } > > >
Quoting Barnabás Pőcze (2025-11-03 14:34:48) > 2025. 11. 03. 15:02 keltezéssel, Dan Scally írta: > > Hi Barnabas > > > > On 03/11/2025 14:00, Barnabás Pőcze wrote: > >> `constraintModes()` and `exposureModeHelpers()` need not return copies of > >> the internal objects, exposing const references is sufficient, so do that. > >> > >> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > > > Wrong tag :) > > Yes :( I have multiple tags pinned in the clipboard manager... I was > wondering how long I can avoid such a mixup. Seems like that day is today. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> :-) Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > > > > > Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> > > > >> --- > >> src/ipa/libipa/agc_mean_luminance.h | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h > >> index d7ec548e3e..e5f164c318 100644 > >> --- a/src/ipa/libipa/agc_mean_luminance.h > >> +++ b/src/ipa/libipa/agc_mean_luminance.h > >> @@ -53,12 +53,12 @@ public: > >> void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, > >> double minGain, double maxGain, std::vector<AgcConstraint> constraints); > >> - std::map<int32_t, std::vector<AgcConstraint>> constraintModes() > >> + const std::map<int32_t, std::vector<AgcConstraint>> &constraintModes() const > >> { > >> return constraintModes_; > >> } > >> - std::map<int32_t, std::shared_ptr<ExposureModeHelper>> exposureModeHelpers() > >> + const std::map<int32_t, std::shared_ptr<ExposureModeHelper>> &exposureModeHelpers() const > >> { > >> return exposureModeHelpers_; > >> } > > > > > > >
diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h index d7ec548e3e..e5f164c318 100644 --- a/src/ipa/libipa/agc_mean_luminance.h +++ b/src/ipa/libipa/agc_mean_luminance.h @@ -53,12 +53,12 @@ public: void setLimits(utils::Duration minExposureTime, utils::Duration maxExposureTime, double minGain, double maxGain, std::vector<AgcConstraint> constraints); - std::map<int32_t, std::vector<AgcConstraint>> constraintModes() + const std::map<int32_t, std::vector<AgcConstraint>> &constraintModes() const { return constraintModes_; } - std::map<int32_t, std::shared_ptr<ExposureModeHelper>> exposureModeHelpers() + const std::map<int32_t, std::shared_ptr<ExposureModeHelper>> &exposureModeHelpers() const { return exposureModeHelpers_; }
`constraintModes()` and `exposureModeHelpers()` need not return copies of the internal objects, exposing const references is sufficient, so do that. Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/agc_mean_luminance.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)