Fix minElementId on MinHeap

This commit is contained in:
Slava Kim
2014-03-19 14:38:52 -07:00
parent 651fd17a84
commit 820caef308
2 changed files with 11 additions and 1 deletions

View File

@@ -7,3 +7,13 @@ MinHeap = function (comparator, options) {
Meteor._inherits(MinHeap, MaxHeap);
_.extend(MinHeap.prototype, {
maxElementId: function () {
throw new Error("Cannot call maxElementId on MinHeap");
},
minElementId: function () {
var self = this;
return MaxHeap.prototype.maxElementId.call(self);
}
});

View File

@@ -47,7 +47,7 @@ _.extend(MinMaxHeap.prototype, {
},
minElementId: function () {
var self = this;
return self._minHeap.maxElementId();
return self._minHeap.minElementId();
}
});