encoding: Block::remove now removes all subelements of type

refs #3070

Change-Id: Ife9cb9fe9ba7e0a79d5f759c9990cbe04b0b87c3
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index 693bc17..77be4f2 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -406,7 +406,7 @@
   resetWire();
 
   auto it = std::remove_if(m_subBlocks.begin(), m_subBlocks.end(),
-                           [type] (const Block& subBlock) { return subBlock.type() != type; });
+                           [type] (const Block& subBlock) { return subBlock.type() == type; });
   m_subBlocks.resize(it - m_subBlocks.begin());
 }