Seems odd to have two ways to say exactly the same thing when one is sufficient.
Replace CountSecondsDouble with Ticks<SecondsDouble> #25480
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2206-ticks-🌗 changing 3 files +4 −9-
MarcoFalke commented at 7:41 AM on June 27, 2022: member
-
Replace CountSecondsDouble with Ticks<SecondsDouble> fa956e7508
- MarcoFalke added the label Refactoring on Jun 27, 2022
- fanquake approved
-
fanquake commented at 12:12 PM on June 28, 2022: member
ACK fa956e7508986991008e2f6126ab307924b3f353
- shaavan approved
-
shaavan commented at 1:35 PM on June 28, 2022: contributor
ACK fa956e7508986991008e2f6126ab307924b3f353
- The refactoring done in this PR is clean and eliminates the redundant dependency.
- I successfully compiled the PR on the
Ubuntu 22.04.
Minor nit: I think the
using SecondsDouble = ...can be moved up with the other definitions.Diff:
--- a/src/util/time.h +++ b/src/util/time.h @@ -24,6 +24,8 @@ struct NodeClock : public std::chrono::system_clock { }; using NodeSeconds = std::chrono::time_point<NodeClock, std::chrono::seconds>; +using SecondsDouble = std::chrono::duration<double, std::chrono::seconds::period>; + using SteadySeconds = std::chrono::time_point<std::chrono::steady_clock, std::chrono::seconds>; using SteadyMilliseconds = std::chrono::time_point<std::chrono::steady_clock, std::chrono::milliseconds>; using SteadyMicroseconds = std::chrono::time_point<std::chrono::steady_clock, std::chrono::microseconds>; @@ -54,8 +56,6 @@ constexpr int64_t count_seconds(std::chrono::seconds t) { return t.count(); } constexpr int64_t count_milliseconds(std::chrono::milliseconds t) { return t.count(); } constexpr int64_t count_microseconds(std::chrono::microseconds t) { return t.count(); } -using SecondsDouble = std::chrono::duration<double, std::chrono::seconds::period>; - - w0xlt approved
-
w0xlt commented at 2:02 PM on June 28, 2022: contributor
- fanquake merged this on Jun 28, 2022
- fanquake closed this on Jun 28, 2022
- sidhujag referenced this in commit 137405c14f on Jun 28, 2022
- MarcoFalke deleted the branch on Jun 29, 2022
- DrahtBot locked this on Jun 29, 2023
Contributors
Labels