diff --git a/components/brave_news/browser/brave_news_p3a.cc b/components/brave_news/browser/brave_news_p3a.cc index c23daa3e0a48..91e45ffd45b3 100644 --- a/components/brave_news/browser/brave_news_p3a.cc +++ b/components/brave_news/browser/brave_news_p3a.cc @@ -341,8 +341,8 @@ void NewsMetrics::OnPublishersChanged() { void NewsMetrics::OnChannelsChanged() { DVLOG(1) << __FUNCTION__; base::flat_set distinct_channels; - for (const auto& [locale, channels] : - pref_manager_->GetSubscriptions().channels()) { + auto channels_map = pref_manager_->GetSubscriptions().channels(); + for (const auto& [locale, channels] : channels_map) { distinct_channels.insert(channels.begin(), channels.end()); } RecordTotalSubscribedCount(SubscribeType::kChannels,