Kaydet (Commit) e473d49f authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 (PVS): redundant nullptr check; loop index size

V668 There is no sense in testing the 's' pointer against null, as the
     memory was allocated using the 'new' operator. The exception will
     be generated in the case of memory allocation error.

V1029 Numeric Truncation Error. Result of the 'size' function is written
     to the 16-bit variable.

Change-Id: I8e0598e892ca160ac074bccfed87c14367a3b46a
Reviewed-on: https://gerrit.libreoffice.org/62139
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 34208a37
......@@ -577,11 +577,8 @@ DdeItem* DdeTopic::AddItem( const DdeItem& r )
else
s = new DdeItem( r );
if ( s )
{
aItems.push_back( s );
s->pMyTopic = this;
}
aItems.push_back( s );
s->pMyTopic = this;
return s;
}
......@@ -770,9 +767,9 @@ short DdeItem::GetLinks()
short nCnt = 0;
if( pImpData )
{
for( sal_uInt16 n = pImpData->size(); n; )
for (const auto& rData : *pImpData)
{
nCnt = nCnt + (*pImpData)[ --n ].nCnt;
nCnt += rData.nCnt;
}
}
return nCnt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment