minor tweaks

This commit is contained in:
Garux
2021-03-20 02:30:11 +03:00
parent ebd90382a4
commit e200ffc762
6 changed files with 27 additions and 27 deletions

View File

@@ -118,12 +118,12 @@ void forEachInstance( const scene::Instantiable::Visitor& visitor ){
}
void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){
ASSERT_MESSAGE( m_instances.find( key_type( observer, PathConstReference( instance->path() ) ) ) == m_instances.end(), "InstanceSet::insert - element already exists" );
m_instances.insert( InstanceMap::value_type( key_type( observer, PathConstReference( instance->path() ) ), instance ) );
const bool inserted = m_instances.insert( InstanceMap::value_type( key_type( observer, PathConstReference( instance->path() ) ), instance ) ).second;
ASSERT_MESSAGE( inserted, "InstanceSet::insert - element already exists" );
}
scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){
ASSERT_MESSAGE( m_instances.find( key_type( observer, PathConstReference( path ) ) ) != m_instances.end(), "InstanceSet::erase - failed to find element" );
InstanceMap::iterator i = m_instances.find( key_type( observer, PathConstReference( path ) ) );
ASSERT_MESSAGE( i != m_instances.end(), "InstanceSet::erase - failed to find element" );
scene::Instance* instance = i->second;
m_instances.erase( i );
return instance;