瀏覽代碼

binary_search sometimes returned -1 instead of 1 when searching over a single item

Ian Goldberg 6 月之前
父節點
當前提交
650561d158
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      duoram.cpp

+ 3 - 1
duoram.cpp

@@ -104,7 +104,9 @@ RegXS Duoram<RegAS>::Shape::binary_search(RegAS &target)
         // answer is here or to the left, so it must be 0.  If val <
         // target, the answer is strictly to the right, so it must be 1.
         // So just return lt.
-        return RegXS(lt);
+        RegXS ret;
+        ret.xshare = lt.bshare;
+        return ret;
     }
     auto oidx = P.oblivindex(depth-1);
     oidx.incr(lt);