mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Implement heap clone with passing an array of the original's data
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user