diff options
author | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-05-13 17:31:35 +0200 |
---|---|---|
committer | Barnabás Pőcze <barnabas.pocze@ideasonboard.com> | 2025-05-27 11:10:23 +0200 |
commit | 4709f8442b993f0be82429b62239ae4b645ff7e1 (patch) | |
tree | b8a8aee0d4f3ee0a4d12052ea8cbb71d57c871be | |
parent | e633d85be9bdf179233ee2cc677ec3edac6df168 (diff) |
libcamera: ipa_data_serializer: Remove some vector `reserve()` calls
`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@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
-rw-r--r-- | include/libcamera/internal/ipa_data_serializer.h | 1 | ||||
-rw-r--r-- | src/libcamera/ipa_data_serializer.cpp | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index b4614f21..b1fefba5 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 2189a246..0537f785 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, {} }; \ |