Simplify a redundant condition in computeDefragCycles (#9076)

Co-authored-by: lizhaolong.lzl <lizhaolong.lzl@B-54MPMD6R-0221.local>
This commit is contained in:
ZhaolongLi 2021-06-14 16:48:15 +08:00 committed by GitHub
parent 688cdb05b4
commit dee378d76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -1060,9 +1060,7 @@ void computeDefragCycles() {
server.active_defrag_cycle_max); server.active_defrag_cycle_max);
/* We allow increasing the aggressiveness during a scan, but don't /* We allow increasing the aggressiveness during a scan, but don't
* reduce it. */ * reduce it. */
if (!server.active_defrag_running || if (cpu_pct > server.active_defrag_running) {
cpu_pct > server.active_defrag_running)
{
server.active_defrag_running = cpu_pct; server.active_defrag_running = cpu_pct;
serverLog(LL_VERBOSE, serverLog(LL_VERBOSE,
"Starting active defrag, frag=%.0f%%, frag_bytes=%zu, cpu=%d%%", "Starting active defrag, frag=%.0f%%, frag_bytes=%zu, cpu=%d%%",