From 1e58bdb41d886be6246f85913b2cd5ec6aae57bd Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Mon, 19 Nov 2018 16:57:02 -0800 Subject: [PATCH] Minor simplifications Change-Id: I231e863f838f449335236c174b74bd33dfdd8b19 --- vp9/encoder/vp9_encoder.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 583435e61..976ba020d 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -6140,16 +6140,12 @@ static void max_heap_push(FEATURE_SCORE_LOC **heap, int *size, ++*size; c = *size - 1; p = c >> 1; - while (c > 0) { - if (heap[c]->feature_score > heap[p]->feature_score) { - tmp = heap[p]; - heap[p] = heap[c]; - heap[c] = tmp; - c = p; - p = c >> 1; - } else { - break; - } + while (c > 0 && heap[c]->feature_score > heap[p]->feature_score) { + tmp = heap[p]; + heap[p] = heap[c]; + heap[c] = tmp; + c = p; + p >>= 1; } } -- 2.40.0