diff options
author | Yaowu Xu <yaowu@google.com> | 2018-11-19 16:57:02 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2018-11-19 17:41:03 -0800 |
commit | 1e58bdb41d886be6246f85913b2cd5ec6aae57bd (patch) | |
tree | b361203e04241cb88a379f9de98d4632036b7ad1 | |
parent | cb240c1c41d30a386ead01ffa473c2561908e78b (diff) | |
download | libvpx-1e58bdb41d886be6246f85913b2cd5ec6aae57bd.tar libvpx-1e58bdb41d886be6246f85913b2cd5ec6aae57bd.tar.gz libvpx-1e58bdb41d886be6246f85913b2cd5ec6aae57bd.tar.bz2 libvpx-1e58bdb41d886be6246f85913b2cd5ec6aae57bd.zip |
Minor simplifications
Change-Id: I231e863f838f449335236c174b74bd33dfdd8b19
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 16 |
1 files 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; } } |