extension: use map in create extension
Adjust the Create extension to use a map for metadata instead of
vector.
Tested: Unit tests updated and passing.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9bd62b8dcc8b18a61958ed64de98b52a48333637
diff --git a/extensions/openpower-pels/additional_data.hpp b/extensions/openpower-pels/additional_data.hpp
index 09dbd20..74abce9 100644
--- a/extensions/openpower-pels/additional_data.hpp
+++ b/extensions/openpower-pels/additional_data.hpp
@@ -38,19 +38,9 @@
* @param[in] ad - the AdditionalData property vector with
* entries of "KEY=VALUE"
*/
- explicit AdditionalData(const std::vector<std::string>& ad)
- {
- for (auto& item : ad)
- {
- auto pos = item.find_first_of('=');
- if (pos == std::string::npos || pos == 0)
- {
- continue;
- }
-
- _data[item.substr(0, pos)] = std::move(item.substr(pos + 1));
- }
- }
+ explicit AdditionalData(const std::map<std::string, std::string>& ad) :
+ _data(ad)
+ {}
/**
* @brief Returns the value of the AdditionalData item for the