diff --git a/components/brave_news/browser/brave_news_p3a.cc b/components/brave_news/browser/brave_news_p3a.cc index e1a7fd039ee3..fd70dc80d277 100644 --- a/components/brave_news/browser/brave_news_p3a.cc +++ b/components/brave_news/browser/brave_news_p3a.cc @@ -335,8 +335,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,