diff --git a/src/engine/cmdStreamOps.cpp b/src/engine/cmdStreamOps.cpp index fa370c85d..9ae9ccce7 100644 --- a/src/engine/cmdStreamOps.cpp +++ b/src/engine/cmdStreamOps.cpp @@ -963,9 +963,6 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock // match length shall be greater than or equal to current length if (len>k.len) continue; - assert(!(k.orig&7)); - assert(memcmp(&buf[k.orig],&buf[k.block],len)==0); - // check for bad matches, which include: // - match overlapping with itself // - block only consisting of calls @@ -997,8 +994,10 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock testLenMatches.push_back(k); } - // try with next size if no further matches - if (testLenMatches.empty()) continue; + // get out if no further matches (trying with bigger sizes is guaranteed to fail) + if (testLenMatches.empty()) { + break; + } // check for overlapping matches size_t overlapPos=testLenMatches[0].orig; @@ -1054,9 +1053,6 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock logV("new sub-block %d",(int)subBlockID); assert(!(bestOrig&7)); - for (size_t i=bestOrig; i& subBlock if (i.done) continue; assert(!(i.block&7)); - for (size_t j=i.block; j