Skip to content
Snippets Groups Projects

Fix bug in DataSvcHelpers::RegistryEntry::remove introduced in !474

@@ -151,15 +151,15 @@ long DataSvcHelpers::RegistryEntry::remove( IRegistry* obj )
}
/// Remove entry from data store
long DataSvcHelpers::RegistryEntry::remove( boost::string_ref nam )
long DataSvcHelpers::RegistryEntry::remove( boost::string_ref path )
{
if ( nam.front() != SEPARATOR ) {
std::string prefixed{SEPARATOR};
prefixed.append( nam.data(), nam.size() );
return remove( prefixed );
}
if ( path.front() == SEPARATOR ) path.remove_prefix( 1 );
// if this object is not present, this is an error....
auto i = std::find_if( m_store.begin(), m_store.end(), [&]( const auto* j ) { return j->name() == nam; } );
auto i = std::find_if( m_store.begin(), m_store.end(), [&]( const auto* j ) {
boost::string_ref name{j->name()};
name.remove_prefix( 1 );
return name == path;
} );
if ( i == m_store.end() ) return StatusCode::FAILURE;
remove( *i );
return StatusCode::SUCCESS;
Loading