From 19eeff650a29369fed01e8f036fb2d67467ff56a Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Thu, 20 Feb 2014 21:45:28 -0800 Subject: [PATCH] Implement heap clone with passing an array of the original's data --- packages/binary-heap/max-heap.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/binary-heap/max-heap.js b/packages/binary-heap/max-heap.js index 6327e58e3d..37fc90c941 100644 --- a/packages/binary-heap/max-heap.js +++ b/packages/binary-heap/max-heap.js @@ -180,9 +180,7 @@ _.extend(MaxHeap.prototype, { }, clone: function () { var self = this; - var clone = new MaxHeap(self._comparator); - clone._heap = EJSON.clone(self._heap); - clone._heapIdx = self._heapIdx.clone(); + var clone = new MaxHeap(self._comparator, self._heap); return clone; },