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

Use reference in range-for with non trivial type #294

Merged
merged 3 commits into from
Jul 8, 2024
Merged

Use reference in range-for with non trivial type #294

merged 3 commits into from
Jul 8, 2024

Conversation

gruenich
Copy link
Contributor

@gruenich gruenich commented Jul 6, 2024

Found by Clazy (range-loop-reference)

Found by Clazy (range-loop-reference)
@derekmauro derekmauro merged commit 151b37b into google:master Jul 8, 2024
5 checks passed
@@ -551,7 +551,7 @@ std::unique_ptr<ZoneInfoSource> FuchsiaZoneInfoSource::Open(
const auto prefixes = name_absolute ? kEmptyPrefix : kTzdataPrefixes;

// Fuchsia builds place zoneinfo files at "<prefix><format><name>".
for (const std::string prefix : prefixes) {
for (const std::string& prefix : prefixes) {
Copy link
Member

Choose a reason for hiding this comment

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

This change is actually incorrect. prefixes is an array of const char[], so this binds a temporary.

derekmauro added a commit that referenced this pull request Jul 8, 2024
derekmauro added a commit that referenced this pull request Jul 8, 2024
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.

3 participants