diff options
author | Ed Tanous <edtanous@google.com> | 2022-02-17 22:40:25 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-03-14 21:57:35 +0300 |
commit | 866e4862e0a6c1b36bf27de0b8f9db3216d4a46c (patch) | |
tree | 8c38891e1cc0ab8dc2360e78073c72fab317a263 /redfish-core/include | |
parent | c5114a57c5460916141260b5d31680f82fdda324 (diff) | |
download | bmcweb-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/include')
-rw-r--r-- | redfish-core/include/utils/hex_utils.hpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/redfish-core/include/utils/hex_utils.hpp b/redfish-core/include/utils/hex_utils.hpp index 8ca3a81b16..c7c89a595f 100644 --- a/redfish-core/include/utils/hex_utils.hpp +++ b/redfish-core/include/utils/hex_utils.hpp @@ -4,9 +4,7 @@ #include <cstddef> #include <string> -template <typename IntegerType> -inline std::string intToHexString(IntegerType value, - size_t digits = sizeof(IntegerType) << 1) +inline std::string intToHexString(uint64_t value, size_t digits) { static constexpr std::array<char, 16> digitsArray = { '0', '1', '2', '3', '4', '5', '6', '7', |