[v2,3/4] libcamera: Use `it` variable name for iterators only
diff mbox series

Message ID 20260212151238.3736234-4-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Clean up iterators
Related show

Commit Message

Laurent Pinchart Feb. 12, 2026, 3:12 p.m. UTC
Using the name `it` for a variable that is not an iterator is confusing.
Give the variable a more explanatory name.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/internal/ipa_data_serializer.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Barnabás Pőcze Feb. 13, 2026, 9:15 a.m. UTC | #1
2026. 02. 12. 16:12 keltezéssel, Laurent Pinchart írta:
> Using the name `it` for a variable that is not an iterator is confusing.
> Give the variable a more explanatory name.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   include/libcamera/internal/ipa_data_serializer.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
> index 61bada52f691..0dda76d5b1d1 100644
> --- a/include/libcamera/internal/ipa_data_serializer.h
> +++ b/include/libcamera/internal/ipa_data_serializer.h
> @@ -114,12 +114,12 @@ public:
>   		appendPOD<uint32_t>(dataVec, vecLen);
>   
>   		/* Serialize the members. */
> -		for (auto const &it : data) {
> +		for (const auto &value : data) {
>   			std::vector<uint8_t> dvec;
>   			std::vector<SharedFD> fvec;
>   
>   			std::tie(dvec, fvec) =
> -				IPADataSerializer<V>::serialize(it, cs);
> +				IPADataSerializer<V>::serialize(value, cs);
>   
>   			appendPOD<uint32_t>(dataVec, dvec.size());
>   			appendPOD<uint32_t>(dataVec, fvec.size());
Isaac Scott March 2, 2026, 5:42 p.m. UTC | #2
Hi Laurent,

Quoting Laurent Pinchart (2026-02-12 15:12:37)
> Using the name `it` for a variable that is not an iterator is confusing.
> Give the variable a more explanatory name.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>

> ---
>  include/libcamera/internal/ipa_data_serializer.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
> index 61bada52f691..0dda76d5b1d1 100644
> --- a/include/libcamera/internal/ipa_data_serializer.h
> +++ b/include/libcamera/internal/ipa_data_serializer.h
> @@ -114,12 +114,12 @@ public:
>                 appendPOD<uint32_t>(dataVec, vecLen);
>  
>                 /* Serialize the members. */
> -               for (auto const &it : data) {
> +               for (const auto &value : data) {
>                         std::vector<uint8_t> dvec;
>                         std::vector<SharedFD> fvec;
>  
>                         std::tie(dvec, fvec) =
> -                               IPADataSerializer<V>::serialize(it, cs);
> +                               IPADataSerializer<V>::serialize(value, cs);
>  
>                         appendPOD<uint32_t>(dataVec, dvec.size());
>                         appendPOD<uint32_t>(dataVec, fvec.size());
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
index 61bada52f691..0dda76d5b1d1 100644
--- a/include/libcamera/internal/ipa_data_serializer.h
+++ b/include/libcamera/internal/ipa_data_serializer.h
@@ -114,12 +114,12 @@  public:
 		appendPOD<uint32_t>(dataVec, vecLen);
 
 		/* Serialize the members. */
-		for (auto const &it : data) {
+		for (const auto &value : data) {
 			std::vector<uint8_t> dvec;
 			std::vector<SharedFD> fvec;
 
 			std::tie(dvec, fvec) =
-				IPADataSerializer<V>::serialize(it, cs);
+				IPADataSerializer<V>::serialize(value, cs);
 
 			appendPOD<uint32_t>(dataVec, dvec.size());
 			appendPOD<uint32_t>(dataVec, fvec.size());