Browse Source

Change insert to return void

It was always returning the constant 1 before.
Ian Goldberg 7 months ago
parent
commit
f594127266
2 changed files with 2 additions and 4 deletions
  1. 1 3
      heap.cpp
  2. 1 1
      heap.hpp

+ 1 - 3
heap.cpp

@@ -167,7 +167,7 @@ void MinHeap::insert_optimized(MPCTIO tio, yield_t & yield, RegAS val) {
 // This process ensures that the newly inserted element is correctly positioned in the heap.
 // The total cost of the insert protocol is log(num_items) oblivious comparisons and log(num_items) oblivious swaps.
 // This protocol follows the approach described as Protocol 3 in the paper "PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures."
-int MinHeap::insert(MPCTIO tio, yield_t & yield, RegAS val) {
+void MinHeap::insert(MPCTIO tio, yield_t & yield, RegAS val) {
     
     auto HeapArray = oram.flat(tio, yield);
     num_items++;
@@ -193,8 +193,6 @@ int MinHeap::insert(MPCTIO tio, yield_t & yield, RegAS val) {
         childindex = parentindex;
         parentindex = parentindex / 2;
     }
-
-    return 1;
 }
 
 

+ 1 - 1
heap.hpp

@@ -32,7 +32,7 @@ public:
     // The Basic Insert Protocol
     // Takes in the additive share of the value to be inserted
     // And adds the the value into the heap while keeping the heap property intact
-    int insert(MPCTIO tio, yield_t & yield, RegAS val);
+    void insert(MPCTIO tio, yield_t & yield, RegAS val);
     
     // The Optimized Insert Protocol
     // Takes in the additive share of the value to be inserted