From d74882266d08e9370421e152d217b53c8daeaebf Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Mon, 5 Oct 2020 08:34:45 +0100 Subject: [PATCH] MythDVDBuffer: Use std::transform to build chapter list --- mythtv/libs/libmythtv/DVD/mythdvdbuffer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythtv/DVD/mythdvdbuffer.cpp b/mythtv/libs/libmythtv/DVD/mythdvdbuffer.cpp index 7eedce40f73..7997a019605 100644 --- a/mythtv/libs/libmythtv/DVD/mythdvdbuffer.cpp +++ b/mythtv/libs/libmythtv/DVD/mythdvdbuffer.cpp @@ -370,8 +370,9 @@ void MythDVDBuffer::GetChapterTimes(QList &Times) GetChapterTimes(m_title); if (!m_chapterMap.contains(m_title)) return; - for (uint64_t chapter : m_chapterMap.value(m_title)) - Times.push_back(static_cast(chapter)); + const QList& chapters = m_chapterMap.value(m_title); + std::transform(chapters.cbegin(), chapters.cend(), std::back_inserter(Times), + [](uint64_t chap) { return static_cast(chap); }); } uint64_t MythDVDBuffer::GetChapterTimes(int Title)