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/memory_vpd_parser.hpp b/vpd-parser/memory_vpd_parser.hpp
index 1b7c9e6..27efafe 100644
--- a/vpd-parser/memory_vpd_parser.hpp
+++ b/vpd-parser/memory_vpd_parser.hpp
@@ -30,7 +30,7 @@
*
* Move memVpdVector to parser object's memVpdVector
*/
- memoryVpdParser(Binary&& VpdVector) : memVpd(std::move(VpdVector))
+ memoryVpdParser(const Binary& VpdVector) : memVpd(VpdVector)
{
}
@@ -59,7 +59,7 @@
kwdVpdMap readKeywords(Binary::const_iterator iterator);
// vdp file to be parsed
- Binary memVpd;
+ const Binary& memVpd;
};
} // namespace parser
} // namespace memory