mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
assert that map.insert() is actually doing something in those cases
where I expect it to.
This commit is contained in:
parent
036c908b72
commit
7253cfa313
3 changed files with 9 additions and 3 deletions
|
@ -133,7 +133,9 @@ RelayConfigs::SetValueFor( const char* key, const char* value )
|
|||
m_values.erase(iter);
|
||||
}
|
||||
|
||||
m_values.insert( pair<const char*,const char*>(strdup(key),strdup(value) ) );
|
||||
pair<map<const char*,const char*>::iterator,bool> result =
|
||||
m_values.insert( pair<const char*,const char*>(strdup(key),strdup(value) ) );
|
||||
assert( result.second );
|
||||
}
|
||||
|
||||
ino_t
|
||||
|
|
|
@ -462,7 +462,9 @@ CRefMgr::AddNew( const char* cookie, const char* connName, CookieID cid,
|
|||
|
||||
ref->assignConnName();
|
||||
|
||||
m_cookieMap.insert( pair<CookieID, CookieRef*>(ref->GetCid(), ref ) );
|
||||
pair<CookieMap::iterator,bool> result =
|
||||
m_cookieMap.insert( pair<CookieID, CookieRef*>(ref->GetCid(), ref ) );
|
||||
assert( result.second );
|
||||
logf( XW_LOGINFO, "%s: paired cookie %s/connName %s with cid %d", __func__,
|
||||
(cookie?cookie:"NULL"), connName, ref->GetCid() );
|
||||
|
||||
|
|
|
@ -171,7 +171,9 @@ ListenerMgr::addOne( int port, bool perGame )
|
|||
success = sock != -1;
|
||||
if ( success ) {
|
||||
pair<int,bool>entry(port, perGame);
|
||||
m_socks_to_ports.insert( pair<int,pair<int,bool> >(sock, entry ) );
|
||||
pair<map<int,pair<int,bool> >::iterator, bool> result
|
||||
= m_socks_to_ports.insert( pair<int,pair<int,bool> >(sock, entry ) );
|
||||
assert( result.second );
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue