<div dir="ltr">Thanks for noticing the mistake.<br><br>Signed-off-by: Nejc Galof <<a href="mailto:galof.nejc@gmail.com" target="_blank">galof.nejc@gmail.com</a>><br><br>Nejc Galof</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">V V pon., 21. feb. 2022 ob 13:57 je oseba Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> napisala:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Nejc,<br>
<br>
On Mon, Feb 21, 2022 at 02:49:46PM +0200, Laurent Pinchart wrote:<br>
> On Sun, Feb 20, 2022 at 01:52:57AM +0100, Nejc Galof wrote:<br>
> > Use structured bindings range-based for loops for better readability.<br>
> <br>
> It looks nicer indeed !<br>
<br>
I forgot to mention that the patch is missing your Signed-off-by line.<br>
Please see <a href="https://libcamera.org/contributing.html#submitting-patches" rel="noreferrer" target="_blank">https://libcamera.org/contributing.html#submitting-patches</a>.<br>
You can use the -s option to git commit to add it. For this patch, you<br>
can just reply to this e-mail with the SoB line and I'll add it locally.<br>
<br>
> > ---<br>
> >  src/cam/camera_session.cpp | 21 +++++++--------------<br>
> >  1 file changed, 7 insertions(+), 14 deletions(-)<br>
> > <br>
> > diff --git a/src/cam/camera_session.cpp b/src/cam/camera_session.cpp<br>
> > index 1bf460fa..0428b538 100644<br>
> > --- a/src/cam/camera_session.cpp<br>
> > +++ b/src/cam/camera_session.cpp<br>
> > @@ -120,10 +120,7 @@ CameraSession::~CameraSession()<br>
> >  <br>
> >  void CameraSession::listControls() const<br>
> >  {<br>
> > -   for (const auto &ctrl : camera_->controls()) {<br>
> > -           const ControlId *id = ctrl.first;<br>
> > -           const ControlInfo &info = ctrl.second;<br>
> > -<br>
> > +   for (const auto &[id, info] : camera_->controls()) {<br>
> >             std::cout << "Control: " << id->name() << ": "<br>
> >                       << info.toString() << std::endl;<br>
> >     }<br>
> <br>
> You can now drop the curly braces.<br>
> <br>
> Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
> <br>
> There's no need to submit a v2, I'll make this small change when<br>
> applying the patch.<br>
> <br>
> > @@ -131,9 +128,8 @@ void CameraSession::listControls() const<br>
> >  <br>
> >  void CameraSession::listProperties() const<br>
> >  {<br>
> > -   for (const auto &prop : camera_->properties()) {<br>
> > -           const ControlId *id = properties::<a href="http://properties.at" rel="noreferrer" target="_blank">properties.at</a>(prop.first);<br>
> > -           const ControlValue &value = prop.second;<br>
> > +   for (const auto &[key, value] : camera_->properties()) {<br>
> > +           const ControlId *id = properties::<a href="http://properties.at" rel="noreferrer" target="_blank">properties.at</a>(key);<br>
> >  <br>
> >             std::cout << "Property: " << id->name() << " = "<br>
> >                       << value.toString() << std::endl;<br>
> > @@ -374,10 +370,7 @@ void CameraSession::processRequest(Request *request)<br>
> >          << std::setw(6) << std::setfill('0') << ts / 1000 % 1000000<br>
> >          << " (" << std::fixed << std::setprecision(2) << fps << " fps)";<br>
> >  <br>
> > -   for (auto it = buffers.begin(); it != buffers.end(); ++it) {<br>
> > -           const Stream *stream = it->first;<br>
> > -           FrameBuffer *buffer = it->second;<br>
> > -<br>
> > +   for (const auto &[stream, buffer] : buffers) {<br>
> >             const FrameMetadata &metadata = buffer->metadata();<br>
> >  <br>
> >             info << " " << streamNames_[stream]<br>
> > @@ -401,10 +394,10 @@ void CameraSession::processRequest(Request *request)<br>
> >  <br>
> >     if (printMetadata_) {<br>
> >             const ControlList &requestMetadata = request->metadata();<br>
> > -           for (const auto &ctrl : requestMetadata) {<br>
> > -                   const ControlId *id = controls::<a href="http://controls.at" rel="noreferrer" target="_blank">controls.at</a>(ctrl.first);<br>
> > +           for (const auto &[key, value] : requestMetadata) {<br>
> > +                   const ControlId *id = controls::<a href="http://controls.at" rel="noreferrer" target="_blank">controls.at</a>(key);<br>
> >                     std::cout << "\t" << id->name() << " = "<br>
> > -                             << ctrl.second.toString() << std::endl;<br>
> > +                             << value.toString() << std::endl;<br>
> >             }<br>
> >     }<br>
> >  <br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div>