Skip to content

Conversation

@turuslan
Copy link
Contributor

@turuslan turuslan commented Dec 22, 2025

@kamilsa kamilsa requested review from kamilsa and xDimon and removed request for kamilsa January 19, 2026 09:09
}
if (not justifications_it->second.at(validator_id)) {
justifications_it->second.at(validator_id) = true;
for (auto &&validator_id :
Copy link
Member

Choose a reason for hiding this comment

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

Why validator_id is rvalue? It doesn't make sense here, do nothing, but confuses a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

auto && is not rvalue, it means that deduced auto may accept both value and reference.

auto c = ref; // copy constructor
auto &c = ref; // reference
auto c = 1; // int c
auto &c = 1; // error
const auto &c = 1; // const int &c
auto &&c = ref; // reference
auto &&c = 1; // int c

Copy link
Member

Choose a reason for hiding this comment

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

Yes, and it makes sense in templates only. In this case, the type will be inferred unambiguously from the return value of the function getAggregatedValidators.

@turuslan turuslan requested a review from xDimon January 20, 2026 12:44
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
}
if (not justifications_it->second.at(validator_id)) {
justifications_it->second.at(validator_id) = true;
for (auto &&validator_id :
Copy link
Member

Choose a reason for hiding this comment

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

Yes, and it makes sense in templates only. In this case, the type will be inferred unambiguously from the return value of the function getAggregatedValidators.

Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	src/blockchain/fork_choice.cpp
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan merged commit 93d9700 into master Jan 23, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants