From 907181bbdf74b186d41a7d3ac62dcd2f7bac8a6d Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 1 Jul 2024 10:44:24 +1000 Subject: [clang-tidy] modernize-make-shared --- xbmc/pvr/channels/PVRChannelGroups.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp index 79a5283eb9..65055c7e5b 100644 --- a/xbmc/pvr/channels/PVRChannelGroups.cpp +++ b/xbmc/pvr/channels/PVRChannelGroups.cpp @@ -79,7 +79,7 @@ void CPVRChannelGroups::Unload() m_groups.clear(); m_allChannelsGroup.reset(); - m_channelGroupFactory.reset(new CPVRChannelGroupFactory); + m_channelGroupFactory = std::make_shared(); m_failedClientsForChannelGroups.clear(); } -- cgit v1.2.3 From a0d63a5af10b06b04490c86bfc25baf186776303 Mon Sep 17 00:00:00 2001 From: Rechi Date: Mon, 1 Jul 2024 10:44:24 +1000 Subject: [clang-tidy] performance-unnecessary-copy-initialization --- xbmc/pvr/channels/PVRChannelGroups.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp index 65055c7e5b..c6539b7533 100644 --- a/xbmc/pvr/channels/PVRChannelGroups.cpp +++ b/xbmc/pvr/channels/PVRChannelGroups.cpp @@ -468,7 +468,7 @@ std::shared_ptr CPVRChannelGroups::GetLastGroup() const std::unique_lock lock(m_critSection); for (auto it = m_groups.crbegin(); it != m_groups.crend(); ++it) { - const auto group{*it}; + const auto& group{*it}; if (!group->ShouldBeIgnored(m_groups)) return group; } @@ -548,7 +548,7 @@ std::shared_ptr CPVRChannelGroups::GetPreviousGroup( std::unique_lock lock(m_critSection); for (auto it = m_groups.crbegin(); it != m_groups.crend(); ++it) { - const auto currentGroup{*it}; + const auto& currentGroup{*it}; // return this entry if (bReturnNext && !currentGroup->IsHidden() && !currentGroup->ShouldBeIgnored(m_groups)) @@ -562,7 +562,7 @@ std::shared_ptr CPVRChannelGroups::GetPreviousGroup( // no match return last visible group for (auto it = m_groups.crbegin(); it != m_groups.crend(); ++it) { - const auto currentGroup{*it}; + const auto& currentGroup{*it}; if (!currentGroup->IsHidden() && !currentGroup->ShouldBeIgnored(m_groups)) return currentGroup; } @@ -581,7 +581,7 @@ std::shared_ptr CPVRChannelGroups::GetNextGroup( std::unique_lock lock(m_critSection); for (auto it = m_groups.cbegin(); it != m_groups.cend(); ++it) { - const auto currentGroup{*it}; + const auto& currentGroup{*it}; // return this entry if (bReturnNext && !currentGroup->IsHidden() && !currentGroup->ShouldBeIgnored(m_groups)) @@ -595,7 +595,7 @@ std::shared_ptr CPVRChannelGroups::GetNextGroup( // no match return first visible group for (auto it = m_groups.cbegin(); it != m_groups.cend(); ++it) { - const auto currentGroup{*it}; + const auto& currentGroup{*it}; if (!currentGroup->IsHidden() && !currentGroup->ShouldBeIgnored(m_groups)) return currentGroup; } -- cgit v1.2.3