Commit 9f82af91 authored by Felix Winterhalter's avatar Felix Winterhalter
Browse files

Change from .at to .find and NULL

parent 57476454
......@@ -276,7 +276,13 @@ public:
*/
//*******************************************************************************************************************
virtual const IBlock* getBlock( const IBlockID& id ) const = 0;
inline const IBlock* getBlock( const IBlockID::IDType& id) const { return iBlocks_.at(id); }
inline const IBlock* getBlock( const IBlockID::IDType& id) const {
auto it = iBlocks_.find(id);
if( it != iBlocks_.end()) return it->second;
return NULL;
}
//*******************************************************************************************************************
/*!
......@@ -291,7 +297,13 @@ public:
*/
//*******************************************************************************************************************
virtual IBlock* getBlock( const IBlockID& id ) = 0;
inline IBlock* getBlock( const IBlockID::IDType& id) { return iBlocks_.at(id); }
inline IBlock* getBlock( const IBlockID::IDType& id) {
auto it = iBlocks_.find(id);
if( it != iBlocks_.end()) return it->second;
return NULL;
}
//*******************************************************************************************************************
/*!
......
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