Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default initialize sleep callback duration in tr_verify_worker #6789

Conversation

nevack
Copy link
Member

@nevack nevack commented Apr 14, 2024

std::chrono::duration is just a wrapper, underlying numerical value member will be default initialized to zero as expected.

See https://en.cppreference.com/w/cpp/chrono/duration

std::chrono::duration is just a wrapper, underlying numerical value member will be default initialized to zero as expected.

See https://en.cppreference.com/w/cpp/chrono/duration

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
@Coeur
Copy link
Collaborator

Coeur commented Apr 21, 2024

21:53:44 The following tests FAILED:
21:53:44 112 - LT.DhtTest.callsPeriodicPeriodically (Failed)
21:53:44 305 - LT.TimerTest.repeatingHonorsInterval (Failed)
21:53:44 310 - LT.TimerTest.repeatingStop (Failed)

Could it be related to the change you made?

Copy link
Member

@tearfur tearfur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the code change, just a nit though:

Strictly speaking, this is a form of "list-initialization" that leads to "value-initialization", so the commit message and PR title should be changed.

From https://en.cppreference.com/w/cpp/language/list_initialization:

Otherwise, if the braced-init-list is empty and T is a class type with a default constructor, value-initialization is performed.

From https://en.cppreference.com/w/cpp/language/value_initialization:

if T is a class type with a default constructor that is neither user-provided nor deleted (that is, it may be a class with an implicitly-defined or defaulted default constructor), the object is zero-initialized...

@Coeur Coeur assigned ckerr and mikedld and unassigned nevack Apr 28, 2024
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks!

@ckerr ckerr merged commit e8a72d9 into transmission:main May 24, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants