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
  1. MarcoFalke commented at 7:41 AM on June 27, 2022: member

    Seems odd to have two ways to say exactly the same thing when one is sufficient.

  2. Replace CountSecondsDouble with Ticks<SecondsDouble> fa956e7508
  3. MarcoFalke added the label Refactoring on Jun 27, 2022
  4. fanquake approved
  5. fanquake commented at 12:12 PM on June 28, 2022: member

    ACK fa956e7508986991008e2f6126ab307924b3f353

  6. shaavan approved
  7. 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>;
    -
    
    
  8. w0xlt approved
  9. fanquake merged this on Jun 28, 2022
  10. fanquake closed this on Jun 28, 2022

  11. sidhujag referenced this in commit 137405c14f on Jun 28, 2022
  12. MarcoFalke deleted the branch on Jun 29, 2022
  13. DrahtBot locked this on Jun 29, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me