aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2023-10-17 11:10:27 +1000
committerGitHub <noreply@github.com>2023-10-17 11:10:27 +1000
commit5cf5e951f04acee506c02470245e6202a228cdbc (patch)
treec30efd9c752c7e03396a661851a463c1b01c0ac5
parent2c7f85b8013414a3772fbf5ce57a6fece6ec9e11 (diff)
parentaba2f8100aa084b6721390b1562ee7761bbffa65 (diff)
downloadxbmc-5cf5e951f04acee506c02470245e6202a228cdbc.tar.xz
Merge pull request #23941 from Rechi/clang-tidy/performance
[clang-tidy] fix performance-* warnings
-rw-r--r--xbmc/favourites/ContextMenus.cpp2
-rw-r--r--xbmc/music/MusicUtils.cpp2
-rw-r--r--xbmc/pvr/guilib/PVRGUIActionsUtils.cpp2
-rw-r--r--xbmc/video/VideoChapterImageFileLoader.cpp2
-rw-r--r--xbmc/video/VideoUtils.cpp4
5 files changed, 6 insertions, 6 deletions
diff --git a/xbmc/favourites/ContextMenus.cpp b/xbmc/favourites/ContextMenus.cpp
index 49f4a7f65d..62f58c77b6 100644
--- a/xbmc/favourites/ContextMenus.cpp
+++ b/xbmc/favourites/ContextMenus.cpp
@@ -83,7 +83,7 @@ namespace
{
std::shared_ptr<CFileItem> ResolveFavouriteItem(const CFileItem& item)
{
- const std::shared_ptr<CFileItem> targetItem{
+ std::shared_ptr<CFileItem> targetItem{
CServiceBroker::GetFavouritesService().ResolveFavourite(item)};
if (targetItem)
targetItem->SetProperty("hide_add_remove_favourite", CVariant{true});
diff --git a/xbmc/music/MusicUtils.cpp b/xbmc/music/MusicUtils.cpp
index fe32d288a6..bbd1ba5ac4 100644
--- a/xbmc/music/MusicUtils.cpp
+++ b/xbmc/music/MusicUtils.cpp
@@ -860,7 +860,7 @@ bool IsNonExistingUserPartyModePlaylist(const CFileItem& item)
if (!item.IsSmartPlayList())
return false;
- const std::string path{item.GetPath()};
+ const std::string& path{item.GetPath()};
const auto profileManager{CServiceBroker::GetSettingsComponent()->GetProfileManager()};
return ((profileManager->GetUserDataItem("PartyMode.xsp") == path) && !CFileUtils::Exists(path));
}
diff --git a/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp b/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp
index 24d918f7f1..907c645dd3 100644
--- a/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp
+++ b/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp
@@ -59,7 +59,7 @@ std::shared_ptr<CFileItem> LoadRecordingFileOrFolderItem(const CFileItem& item)
CFileItemList items;
if (XFILE::CDirectory::GetDirectory(parentPath, items, "", XFILE::DIR_FLAG_DEFAULTS))
{
- const std::string path{item.GetPath()};
+ const std::string& path{item.GetPath()};
const auto it = std::find_if(items.cbegin(), items.cend(),
[&path](const auto& entry) { return entry->GetPath() == path; });
if (it != items.cend())
diff --git a/xbmc/video/VideoChapterImageFileLoader.cpp b/xbmc/video/VideoChapterImageFileLoader.cpp
index 5cb0704ff4..49bfd2dc06 100644
--- a/xbmc/video/VideoChapterImageFileLoader.cpp
+++ b/xbmc/video/VideoChapterImageFileLoader.cpp
@@ -30,7 +30,7 @@ std::unique_ptr<CTexture> VIDEO::CVideoChapterImageFileLoader::Load(
// "goofy" chapter path because these paths don't yet conform to 'image://' path standard
// 10 = length of "chapter://" string prefix from GUIDialogVideoBookmarks
- size_t lastSlashPos = goofyChapterPath.rfind("/");
+ size_t lastSlashPos = goofyChapterPath.rfind('/');
std::string cleanname = goofyChapterPath.substr(10, lastSlashPos - 10);
int chapterNum = 0;
diff --git a/xbmc/video/VideoUtils.cpp b/xbmc/video/VideoUtils.cpp
index e6b5639849..66a78477cb 100644
--- a/xbmc/video/VideoUtils.cpp
+++ b/xbmc/video/VideoUtils.cpp
@@ -527,7 +527,7 @@ bool IsNonExistingUserPartyModePlaylist(const CFileItem& item)
if (!item.IsSmartPlayList())
return false;
- const std::string path{item.GetPath()};
+ const std::string& path{item.GetPath()};
const auto profileManager{CServiceBroker::GetSettingsComponent()->GetProfileManager()};
return ((profileManager->GetUserDataItem("PartyMode-Video.xsp") == path) &&
!CFileUtils::Exists(path));
@@ -820,7 +820,7 @@ ResumeInformation GetStackPartResumeInformation(const CFileItem& item, unsigned
if (item.IsStack())
{
- const std::string path = item.GetDynPath();
+ const std::string& path = item.GetDynPath();
if (URIUtils::IsDiscImageStack(path))
{
// disc image stack