summaryrefslogtreecommitdiff
path: root/redfish-core/lib/memory.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-02-17 22:40:25 +0300
committerEd Tanous <ed@tanous.net>2022-03-14 21:57:35 +0300
commit866e4862e0a6c1b36bf27de0b8f9db3216d4a46c (patch)
tree8c38891e1cc0ab8dc2360e78073c72fab317a263 /redfish-core/lib/memory.hpp
parentc5114a57c5460916141260b5d31680f82fdda324 (diff)
downloadbmcweb-866e4862e0a6c1b36bf27de0b8f9db3216d4a46c.tar.xz
Detemplateify intToHexString
The routine of intToHexString is mostly common between all the various implementations, the only difference is in selecting a reasonable default size for the type. This commit moves to a common method, so the templates don't get created for each and every instantiation of intToHexString, and simplifies our code. This saves a trivial amount (428 bytes) of compressed binary size. Tested: Unit tests passing, and have good coverage of this. Memory resources return the values as were there previously. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6945a81a5e03c7a64d6a2a0629b24db941271930
Diffstat (limited to 'redfish-core/lib/memory.hpp')
-rw-r--r--redfish-core/lib/memory.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index f20681b61c..495b0a5f47 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -152,7 +152,7 @@ inline void dimmPropToHex(
return;
}
- aResp->res.jsonValue[key] = "0x" + intToHexString(*value);
+ aResp->res.jsonValue[key] = "0x" + intToHexString(*value, 4);
}
inline void getPersistentMemoryProperties(