Kajetan Johannes Hammerle 3 gadi atpakaļ
vecāks
revīzija
5b06c611e2
1 mainītis faili ar 2 papildinājumiem un 8 dzēšanām
  1. 2 8
      common/block/BlockRegistry.cpp

+ 2 - 8
common/block/BlockRegistry.cpp

@@ -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];
 }