From a71d0f15a3e2584a4f83f7cc6d9c9bbec99ea4f7 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 1 Jun 2017 19:19:09 -0500 Subject: fru_gen: eliminate unnecessary maps The type of the generated fru data contained a map of a map of a map of a map, but for all except the outermost map, all elements were iterated over when using the map. Therefore, change them to a vector> instead. Vector should generate smaller code and allow faster iteration. Vector insert and iteration are both linear where as map is O(n lg n). Change-Id: I475e5a40b4051e4ce9478a565c889c1751241987 Signed-off-by: Patrick Williams --- frup.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'frup.hpp') diff --git a/frup.hpp b/frup.hpp index 09ffc9f..15b5eaf 100644 --- a/frup.hpp +++ b/frup.hpp @@ -5,6 +5,7 @@ #include #include #include +#include enum ipmi_fru_area_type { @@ -83,16 +84,16 @@ struct IPMIFruData }; using DbusProperty = std::string; -using DbusPropertyMap = std::map; +using DbusPropertyVec = std::vector>; using DbusInterface = std::string; -using DbusInterfaceMap = std::map; +using DbusInterfaceVec = std::vector>; using FruInstancePath = std::string; -using FruInstanceMap = std::map; +using FruInstanceVec = std::vector>; using FruId = uint32_t; -using FruMap = std::map; +using FruMap = std::map; /* Parse an IPMI write fru data message into a dictionary containing name value pair of VPD entries.*/ int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl); -- cgit v1.2.1