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/parser_factory.cpp b/vpd-parser/parser_factory.cpp
index 0489ef1..cc587a7 100644
--- a/vpd-parser/parser_factory.cpp
+++ b/vpd-parser/parser_factory.cpp
@@ -22,7 +22,7 @@
{
namespace factory
{
-interface::ParserInterface* ParserFactory::getParser(Binary&& vpdVector)
+interface::ParserInterface* ParserFactory::getParser(const Binary& vpdVector)
{
vpdType type = vpdTypeCheck(vpdVector);
@@ -30,17 +30,17 @@
{
case IPZ_VPD:
{
- return new IpzVpdParser(std::move(vpdVector));
+ return new IpzVpdParser(vpdVector);
}
case KEYWORD_VPD:
{
- return new KeywordVpdParser(std::move(vpdVector));
+ return new KeywordVpdParser(vpdVector);
}
case MEMORY_VPD:
{
- return new memoryVpdParser(std::move(vpdVector));
+ return new memoryVpdParser(vpdVector);
}
default: