Permalink
Browse files

Few more size() replacements with empty() or isEmpty(). Silences some…

… warnings from cppcheck and other SA tools.
  • Loading branch information...
stuartm authored and jyavenard committed Feb 16, 2013
1 parent 5a30d62 commit a226f628e6cb1783b4f0e22cc711dde43b81eee2
@@ -472,7 +472,7 @@ void MHListGroup::Deactivation(MHEngine *engine)
// which aren't.
void MHListGroup::Update(MHEngine *engine)
{
if (!m_ItemList.size()) // Special cases when the list becomes empty
if (m_ItemList.isEmpty()) // Special cases when the list becomes empty
{
if (m_fFirstItemDisplayed)
{
@@ -95,7 +95,7 @@ void MetadataDownload::run()
else if (!lookup->GetSubtitle().isEmpty())
list = handleVideoUndetermined(lookup);
if (!list.size())
if (list.isEmpty())
list = handleRecordingGeneric(lookup);
}
else if (lookup->GetSubtype() == kProbableMovie)
@@ -261,7 +261,7 @@ void MetadataFactory::VideoScan(QStringList hosts)
void MetadataFactory::OnMultiResult(MetadataLookupList list)
{
if (!list.size())
if (list.isEmpty())
return;
if (m_parent)
@@ -459,7 +459,7 @@ void MythRAOPConnection::SendResendRequest(uint64_t timestamp,
*/
void MythRAOPConnection::ExpireResendRequests(uint64_t timestamp)
{
if (!m_resends.size())
if (m_resends.isEmpty())
return;
QMutableMapIterator<uint16_t,uint64_t> it(m_resends);
@@ -1621,7 +1621,7 @@ vector<uint> CardUtil::GetSharedInputGroups(uint cardid)
return list;
list = GetInputGroups(inputs[0]);
for (uint i = 1; (i < inputs.size()) && list.size(); i++)
for (uint i = 1; (i < inputs.size()) && !list.empty(); i++)
{
vector<uint> curlist = GetInputGroups(inputs[i]);
vector<uint> newlist;
@@ -639,7 +639,7 @@ bool MPEGStreamData::CreatePMTSingleProgram(const ProgramMapTable &pmt)
for (uint i = 0; i < audioPIDs.size(); i++)
AddAudioPID(audioPIDs[i]);
if (videoPIDs.size() >= 1)
if (!videoPIDs.empty())
_pid_video_single_program = videoPIDs[0];
for (uint i = 1; i < videoPIDs.size(); i++)
AddWritingPID(videoPIDs[i]);
@@ -362,7 +362,7 @@ void VAAPIContext::InitPictureAttributes(VideoColourSpace &colourspace)
colourspace.SetSupportedAttributes((PictureAttributeSupported)supported_controls);
delete [] attribs;
if (!supported.size())
if (supported.isEmpty())
return;
m_pictureAttributeCount = supported.size();
@@ -302,7 +302,7 @@ void JoystickMenuThread::EmitKey(QString code)
// Send a dummy keycode if we couldn't convert the key sequence.
// This is done so the main code can output a warning for bad
// mappings.
if (!a.count())
if (a.isEmpty())
QCoreApplication::postEvent(m_mainWindow, new JoystickKeycodeEvent(code,
keycode, true));
@@ -352,7 +352,7 @@ void LIRC::Process(const QByteArray &data)
// Send a dummy keycode if we couldn't convert the key sequence.
// This is done so the main code can output a warning for bad
// mappings.
if (!a.count())
if (a.isEmpty())
{
QCoreApplication::postEvent(
m_mainWindow, new LircKeycodeEvent(
@@ -247,7 +247,7 @@ bool MythXDisplay::CheckErrors(Display *disp)
Sync();
const std::vector<XErrorEvent>& events = xerrors[d];
if (events.size() < 1)
if (events.empty())
return true;
for (int i = events.size() -1; i>=0; --i)
@@ -275,7 +275,7 @@ bool MythXDisplay::CheckErrors(Display *disp)
void MythXDisplay::CheckOrphanedErrors(void)
{
if (xerrors.size() < 1)
if (xerrors.empty())
return;
std::map<Display*, XErrorVectorType>::iterator errors = xerrors.begin();

0 comments on commit a226f62

Please sign in to comment.