Both brute and intense mode can be active

This commit is contained in:
Christian Schneider 2017-08-14 07:01:31 +02:00
parent b63677c4d9
commit b8dffbbba6

View file

@ -2284,12 +2284,12 @@ int def(FILE *source, FILE *dest, int level, int windowbits, int memlevel) {
return Z_OK;
}
// Brute mode detects everything that intense mode detects, so it makes no sense
// having both active. But since both of them can have a level limit, two helper
// functions make things easier to handle.
// Brute mode detects a bit less than intense mode to avoid false positives
// and slowdowns, so both can be active. Also, both of them can have a level
// limit, so two helper functions make things easier to handle.
bool intense_mode_is_active() {
if ((!intense_mode) || (brute_mode_is_active())) return false;
if (!intense_mode) return false;
if ((intense_mode_depth_limit == -1) || (recursion_depth <= intense_mode_depth_limit)) return true;
return false;