|
@@ -21,15 +21,9 @@ void BlockRegistry::add(const char* registry) {
|
|
|
|
|
|
const Block& BlockRegistry::getBlock(const BlockName& registry) const {
|
|
|
const BlockId* id = registryToId.search(registry);
|
|
|
- if(id == nullptr) {
|
|
|
- return blocks[0];
|
|
|
- }
|
|
|
- return blocks[*id];
|
|
|
+ return id == nullptr ? blocks[0] : blocks[*id];
|
|
|
}
|
|
|
|
|
|
const Block& BlockRegistry::getBlock(BlockId id) const {
|
|
|
- if(id < blocks.getLength()) {
|
|
|
- return blocks[id];
|
|
|
- }
|
|
|
- return blocks[0];
|
|
|
+ return id < blocks.getLength() ? blocks[id] : blocks[0];
|
|
|
}
|