Skip to content

Commit

Permalink
clazy: two fixes in channelutil.cpp
Browse files Browse the repository at this point in the history
1) Mark container as const to prevent possible detaching.

2) Move data structure allocation outside of the loop.
  • Loading branch information
linuxdude42 committed Oct 26, 2022
1 parent 9bc3ae0 commit 7194e3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/channelutil.cpp
Expand Up @@ -2138,7 +2138,7 @@ ChannelInfoList ChannelUtil::GetChannelsInternal(

chan.m_xmltvId = query.value(11).toString(); /* xmltvid */

for (auto inputId : inputIdLists[qSourceID])
for (auto inputId : qAsConst(inputIdLists[qSourceID]))
chan.AddInputId(inputId);

QStringList groupIDs = query.value(10).toString().split(",");
Expand Down Expand Up @@ -2568,6 +2568,7 @@ ChannelInfoList ChannelUtil::LoadChannels(uint startIndex, uint count,
return channelList;
}

QList<uint> groupIdList;
while (query.next())
{
ChannelInfo channelInfo;
Expand Down Expand Up @@ -2602,7 +2603,7 @@ ChannelInfoList ChannelUtil::LoadChannels(uint startIndex, uint count,
channelInfo.m_chanId = query.value(27).toUInt();

QStringList groupIDs = query.value(28).toString().split(",");
QList<uint>groupIdList;
groupIdList.clear();
while (!groupIDs.isEmpty())
groupIdList.push_back(groupIDs.takeFirst().toUInt());
std::sort(groupIdList.begin(), groupIdList.end());
Expand Down

0 comments on commit 7194e3f

Please sign in to comment.