vpd:pass vector by reference to avoid copy of vector
When the vector is moved from one class to another, it doesn't
solve the other purpose where the vector data is required after
moving it. In these cases we have to create a local copy of vector
before moving it.
In order to avoid local copy of vector, instead of moving it,
this commit simply passes the vector by reference which solves
all purpose.
Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I29f632651107d65a30e2eca785c9d5ee3ea4042a
diff --git a/impl.hpp b/impl.hpp
index 6dca5e0..dff6aa7 100644
--- a/impl.hpp
+++ b/impl.hpp
@@ -68,7 +68,7 @@
*
* @param[in] vpdBuffer - Binary VPD
*/
- explicit Impl(Binary&& vpdBuffer) : vpd(std::move(vpdBuffer)), out{}
+ explicit Impl(const Binary& vpdBuffer) : vpd(vpdBuffer), out{}
{
}
@@ -157,7 +157,7 @@
openpower::vpd::constants::RecordOffset getVtocOffset() const;
/** @brief VPD in binary format */
- Binary vpd;
+ const Binary& vpd;
/** @brief parser output */
Parsed out;