diff --git a/src/engine/cmdStreamOps.cpp b/src/engine/cmdStreamOps.cpp index b347344d5..da400ac52 100644 --- a/src/engine/cmdStreamOps.cpp +++ b/src/engine/cmdStreamOps.cpp @@ -675,17 +675,19 @@ struct BlockMatch { #define OVERLAPS(a1,a2,b1,b2) ((b1)<(a2) && (b2)>(a1)) +#define MIN_MATCH_SIZE 16 + // TODO: // - check whether a block consists only of calls // - see if we can optimize better SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlocks, unsigned char* speedDial) { unsigned char* buf=stream->getFinalBuf(); - size_t matchSize=48; + size_t matchSize=MIN_MATCH_SIZE; std::vector matches; // repeat until we run out of matches while (true) { - matchSize=48; + matchSize=MIN_MATCH_SIZE; matches.clear(); // fast match algorithm @@ -747,8 +749,6 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock // self-overlapping i.done=true; } else { - nonOverlapCount++; - /* bool onlyCalls=true; for (size_t j=i.orig; j& subBlock } else { nonOverlapCount++; } - */ } } @@ -784,7 +783,7 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock if (i.len>matchSize) matchSize=i.len; } - //while (matchSize>=48) { + //while (matchSize>=MIN_MATCH_SIZE) { workMatches.clear(); // find matches with matching size for (BlockMatch& i: matches) { @@ -911,7 +910,7 @@ SafeWriter* findSubBlocks(SafeWriter* stream, std::vector& subBlock } } - //if (matchSize>=48) { + //if (matchSize>=MIN_MATCH_SIZE) { //logV("trying next size %d",matchSize); //} //}