[RFC PATCH v1 6/8] libcamera: ipa_data_serializer: Remove some vector `reserve()` calls
Barnabás Pőcze
barnabas.pocze at ideasonboard.com
Thu May 15 14:00:10 CEST 2025
`appendPOD()` does a single insertion, so if only a single `appendPOD()`
will be called on a vector before returning, then calling `reserve()`
is not that useful, so remove it.
Signed-off-by: Barnabás Pőcze <barnabas.pocze at ideasonboard.com>
---
include/libcamera/internal/ipa_data_serializer.h | 1 -
src/libcamera/ipa_data_serializer.cpp | 1 -
2 files changed, 2 deletions(-)
diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h
index b4614f21d..b1fefba58 100644
--- a/include/libcamera/internal/ipa_data_serializer.h
+++ b/include/libcamera/internal/ipa_data_serializer.h
@@ -309,7 +309,6 @@ public:
serialize(const Flags<E> &data, [[maybe_unused]] ControlSerializer *cs = nullptr)
{
std::vector<uint8_t> dataVec;
- dataVec.reserve(sizeof(Flags<E>));
appendPOD<uint32_t>(dataVec, static_cast<typename Flags<E>::Type>(data));
return { dataVec, {} };
diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp
index 2189a2466..0537f785b 100644
--- a/src/libcamera/ipa_data_serializer.cpp
+++ b/src/libcamera/ipa_data_serializer.cpp
@@ -196,7 +196,6 @@ IPADataSerializer<type>::serialize(const type &data, \
[[maybe_unused]] ControlSerializer *cs) \
{ \
std::vector<uint8_t> dataVec; \
- dataVec.reserve(sizeof(type)); \
appendPOD<type>(dataVec, data); \
\
return { dataVec, {} }; \
--
2.49.0
More information about the libcamera-devel
mailing list