@@ -164,10 +164,10 @@ export default class MinHeap {
164
164
// If there is no parent or parent is less then node to delete then heapify down.
165
165
// Otherwise heapify up.
166
166
if (
167
- leftChild !== null &&
168
- (
169
- parentItem === null ||
170
- this . compare . lessThan ( parentItem , this . heapContainer [ indexToRemove ] )
167
+ leftChild !== null
168
+ && (
169
+ parentItem === null
170
+ || this . compare . lessThan ( parentItem , this . heapContainer [ indexToRemove ] )
171
171
)
172
172
) {
173
173
this . heapifyDown ( indexToRemove ) ;
@@ -208,8 +208,8 @@ export default class MinHeap {
208
208
let currentIndex = customStartIndex || this . heapContainer . length - 1 ;
209
209
210
210
while (
211
- this . hasParent ( currentIndex ) &&
212
- this . compare . lessThan ( this . heapContainer [ currentIndex ] , this . parent ( currentIndex ) )
211
+ this . hasParent ( currentIndex )
212
+ && this . compare . lessThan ( this . heapContainer [ currentIndex ] , this . parent ( currentIndex ) )
213
213
) {
214
214
this . swap ( currentIndex , this . getParentIndex ( currentIndex ) ) ;
215
215
currentIndex = this . getParentIndex ( currentIndex ) ;
@@ -227,8 +227,8 @@ export default class MinHeap {
227
227
228
228
while ( this . hasLeftChild ( currentIndex ) ) {
229
229
if (
230
- this . hasRightChild ( currentIndex ) &&
231
- this . compare . lessThan ( this . rightChild ( currentIndex ) , this . leftChild ( currentIndex ) )
230
+ this . hasRightChild ( currentIndex )
231
+ && this . compare . lessThan ( this . rightChild ( currentIndex ) , this . leftChild ( currentIndex ) )
232
232
) {
233
233
nextIndex = this . getRightChildIndex ( currentIndex ) ;
234
234
} else {
0 commit comments