Skip to content
Commit 964a8327 authored by Sayooj K Karun's avatar Sayooj K Karun Committed by Anas Nashif
Browse files

lib: min_heap: Refactor heapify_up/down functions



Remove using `swap()` which was using VLA and replace it
with `byteswp()`.
Reduce the scope of local variables in `heapify_up/down` to
the smallest necessary block.
Replace `while(true)` loop in `heapify_down()` with a bounded `for`
loop.

Signed-off-by: default avatarSayooj K Karun <sayooj@aerlync.com>
parent cabf2c4d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment