]> granicus.if.org Git - libvpx/commitdiff
Minor simplifications
authorYaowu Xu <yaowu@google.com>
Tue, 20 Nov 2018 00:57:02 +0000 (16:57 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 20 Nov 2018 01:41:03 +0000 (17:41 -0800)
Change-Id: I231e863f838f449335236c174b74bd33dfdd8b19

vp9/encoder/vp9_encoder.c

index 583435e61a9fe078daccacf5e2373a79451bac49..976ba020dc19df1353b71fc6f8fe933268f22bec 100644 (file)
@@ -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;
   }
 }