64,648
社区成员
发帖
与我相关
我的任务
分享
m_vecRepeatAllIP.clear();
string strIP1 = "";
string strIP2 = "";
map<string, stWangBaInfo*>::iterator itNew = m_mapNewWangBaInfo.begin();
for ( ; itNew != m_mapNewWangBaInfo.end(); ++itNew )
{
if ( itNew == (--m_mapNewWangBaInfo.end()) )
break;
strIP1 = itNew->first;
++itNew;
strIP2 = itNew->first;
if ( 0 == strcmp( strIP1.c_str(), strIP2.c_str() ) )
{
m_vecRepeatAllIP.push_back( strIP1 );
}
--itNew;
}
sort( m_vecRepeatAllIP.begin(), m_vecRepeatAllIP.end() );
vector<string>::iterator it = unique( m_vecRepeatAllIP.begin(), m_vecRepeatAllIP.end() );
m_vecRepeatAllIP.erase( it, m_vecRepeatAllIP.end() );