Browse Source

XOR with !tio.player() instead of tio.player()

Because the latter returns 2 for P2.
Ian Goldberg 7 months ago
parent
commit
03b6562737
1 changed files with 1 additions and 1 deletions
  1. 1 1
      heap.cpp

+ 1 - 1
heap.cpp

@@ -414,7 +414,7 @@ std::pair<RegXS, RegBS> MinHeap::restore_heap_property_optimized(MPCTIO tio, yie
     leftchildindex = index << 1;
 
     RegXS rightchildindex;
-    rightchildindex.xshare = leftchildindex.xshare ^ tio.player();
+    rightchildindex.xshare = leftchildindex.xshare ^ (!tio.player());
 
     typename Duoram < RegAS > ::Flat P(HeapArray, tio, yield, 1 << layer, 1 << layer);
     typename Duoram < RegAS > ::Flat C(HeapArray, tio, yield, 2 << layer, 2 << layer);