mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
16 lines
315 B
JavaScript
16 lines
315 B
JavaScript
import { MaxHeap } from './max-heap.js';
|
|
|
|
export class MinHeap extends MaxHeap {
|
|
constructor(comparator, options) {
|
|
super((a, b) => -comparator(a, b), options);
|
|
}
|
|
|
|
maxElementId() {
|
|
throw new Error("Cannot call maxElementId on MinHeap");
|
|
}
|
|
|
|
minElementId() {
|
|
return super.maxElementId();
|
|
}
|
|
};
|