mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
20 lines
426 B
JavaScript
20 lines
426 B
JavaScript
MinHeap = function (comparator, options) {
|
|
var self = this;
|
|
MaxHeap.call(self, function (a, b) {
|
|
return -comparator(a, b);
|
|
}, 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);
|
|
}
|
|
});
|
|
|