diff options
author | Ed Tanous <ed@tanous.net> | 2024-04-07 23:56:55 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-11 21:21:42 +0300 |
commit | c98dbc641e0973e8db4f701c18d3254f40a02e7b (patch) | |
tree | 993ee5cd8083170c009e2566a1db05a1ffdece4f /redfish-core | |
parent | c09966bdaac3b31e6a4b6adc75cc7481727f6c99 (diff) | |
download | bmcweb-c98dbc641e0973e8db4f701c18d3254f40a02e7b.tar.xz |
Remove logically dead code
Stage::T is never set, so it can never happen. Remove it entirely.
Found using static analysis.
Tested: Unit tests pass, good coverage here
Change-Id: I0dfb1aad5bef3ab4451df5e81794e56074f6e939
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'redfish-core')
-rw-r--r-- | redfish-core/include/utils/time_utils.hpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp index 30011e3d9b..1708998798 100644 --- a/redfish-core/include/utils/time_utils.hpp +++ b/redfish-core/include/utils/time_utils.hpp @@ -53,7 +53,6 @@ inline std::optional<std::chrono::milliseconds> // P1DT1H1M1.100S P, Days, - T, Hours, Minutes, Seconds, @@ -74,14 +73,10 @@ inline std::optional<std::chrono::milliseconds> stage = ProcessingStage::Days; continue; } - if (stage == ProcessingStage::Days || stage == ProcessingStage::T) + if (stage == ProcessingStage::Days) { if (v.front() == 'T') { - if (stage == ProcessingStage::T) - { - return std::nullopt; - } v.remove_prefix(1); stage = ProcessingStage::Hours; continue; |