summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-03-21 10:28:41 +0100
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-04-22 14:49:10 +0200
commitf31da7272eb0d8dfcd551057b24b5ca4f6985713 (patch)
treedff0ec5685f68435befccbfc2570d4c9e574c3f0
parent86c45c8fdf36b6983ad0d585184218f541bb4fd5 (diff)
libcamera: ipa_module: Avoid unnecessary copy when getting signature
The `signature()` getter can just return a reference to the private vector member variable, and let the caller make a copy if needed. Since the return type is const qualified, this was likely the original intention. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
-rw-r--r--include/libcamera/internal/ipa_module.h2
-rw-r--r--src/libcamera/ipa_module.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h
index 7c49d3f3..15f19492 100644
--- a/include/libcamera/internal/ipa_module.h
+++ b/include/libcamera/internal/ipa_module.h
@@ -29,7 +29,7 @@ public:
bool isValid() const;
const struct IPAModuleInfo &info() const;
- const std::vector<uint8_t> signature() const;
+ const std::vector<uint8_t> &signature() const;
const std::string &path() const;
bool load();
diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index 9ca74be6..e6ea61e4 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -373,7 +373,7 @@ const struct IPAModuleInfo &IPAModule::info() const
*
* \return The IPA module signature
*/
-const std::vector<uint8_t> IPAModule::signature() const
+const std::vector<uint8_t> &IPAModule::signature() const
{
return signature_;
}