소스 검색

fixing indentation in online.cpp

avadapal 7 달 전
부모
커밋
bfd30696e6
2개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      heap.cpp
  2. 1 2
      online.cpp

+ 3 - 3
heap.cpp

@@ -221,7 +221,7 @@ void MinHeap::verify_heap_property(MPCTIO tio, yield_t & yield) {
         #endif
     }
     
-    for (size_t j = 2; j <= num_items; ++j) {
+    for (size_t j = 2; j < num_items; ++j) {
         if (heapreconstruction[j/2] > heapreconstruction[j]) {
             std::cout << "heap property failure\n\n";
             std::cout << "j = " << j << std::endl;
@@ -497,8 +497,8 @@ void MinHeap::print_heap(MPCTIO tio, yield_t & yield) {
     uint64_t * Pjreconstruction = new uint64_t[num_items + 1];
     for (size_t j = 0; j <= num_items; ++j)  Pjreconstruction[j] = mpc_reconstruct(tio, yield, HeapArray[j]);
     for (size_t j = 0; j <= num_items; ++j) {
-        if(2 * j < num_items) {
-            std::cout << j << "-->> HeapArray[" << j << "] = " << std::dec << Pjreconstruction[j] << ", children are: " << Pjreconstruction[2 * j] << " and " << Pjreconstruction[2 * j + 1] <<  std::endl;
+        if(2 * j < num_items) { 
+            std::cout << j << "-->> HeapArray[" << j << "] = " <<   Pjreconstruction[j] << ", children are: " << Pjreconstruction[2 * j] << " and " << Pjreconstruction[2 * j + 1] <<  std::endl;
         } else {
             std::cout << j << "-->> HeapArray[" << j << "] = " << std::dec << Pjreconstruction[j] << " is a LEAF " <<  std::endl;
         }

+ 1 - 2
online.cpp

@@ -1625,8 +1625,7 @@ void online_main(MPCIO &mpcio, const PRACOptions &opts, char **args, int argc)
     } else if (!strcmp(*args, "cell")) {
         ++args;
         cell(mpcio, opts, args);
-    } 
-     else if (!strcmp(*args, "heap")) {
+    } else if (!strcmp(*args, "heap")) {
         ++args;
         Heap(mpcio, opts, args, argc);
     } else {