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/vpd-parser/ipz_parser.hpp b/vpd-parser/ipz_parser.hpp
index cb8c489..a4d031b 100644
--- a/vpd-parser/ipz_parser.hpp
+++ b/vpd-parser/ipz_parser.hpp
@@ -32,7 +32,7 @@
/**
* @brief Constructor
*/
- IpzVpdParser(Binary&& VpdVector) : vpd(std::move(VpdVector))
+ IpzVpdParser(const Binary& VpdVector) : vpd(VpdVector)
{
}
@@ -58,7 +58,7 @@
void processHeader();
private:
- Binary vpd;
+ const Binary& vpd;
}; // class IpzVpdParser
} // namespace parser