-
Thayumanavar S authored
Scheduling of the events based on timeline is not honored when some event is removed. This is because when we remove an event from any position in the priority queue, we need to adjust heap both upward and downward depending on new value at the deleted node and the value of the parent node. In the current code, _downheap() adjusts the heap downwards. The queue_fix() function adjusts the heap at every location by calling _downheap and this ensures the heap property is satisfied if we call queue_fix() method after removing the element from an interior node in the heap. The patch fixes the problem mentioned by ensuring after an event is removed from the queue at any index other than 0(top element), we call queue_fix() function. This ensures the heap property is maintained. Change-Id: I83c6c593f92ad9e126d846b400fb9f85f65e2273
Thayumanavar S authoredScheduling of the events based on timeline is not honored when some event is removed. This is because when we remove an event from any position in the priority queue, we need to adjust heap both upward and downward depending on new value at the deleted node and the value of the parent node. In the current code, _downheap() adjusts the heap downwards. The queue_fix() function adjusts the heap at every location by calling _downheap and this ensures the heap property is satisfied if we call queue_fix() method after removing the element from an interior node in the heap. The patch fixes the problem mentioned by ensuring after an event is removed from the queue at any index other than 0(top element), we call queue_fix() function. This ensures the heap property is maintained. Change-Id: I83c6c593f92ad9e126d846b400fb9f85f65e2273
Loading