mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-26 03:08:55 -06:00
fix in gu_buf_heap_pop
This commit is contained in:
@@ -360,13 +360,8 @@ GU_API void
|
|||||||
gu_buf_heap_pop(GuBuf *buf, GuOrder *order, void* data_out)
|
gu_buf_heap_pop(GuBuf *buf, GuOrder *order, void* data_out)
|
||||||
{
|
{
|
||||||
const void* last = gu_buf_trim(buf); // raises an error if empty
|
const void* last = gu_buf_trim(buf); // raises an error if empty
|
||||||
|
memcpy(data_out, buf->seq->data, buf->elem_size);
|
||||||
if (gu_buf_length(buf) > 0) {
|
gu_heap_siftup(buf, order, last, 0);
|
||||||
memcpy(data_out, buf->seq->data, buf->elem_size);
|
|
||||||
gu_heap_siftup(buf, order, last, 0);
|
|
||||||
} else {
|
|
||||||
memcpy(data_out, last, buf->elem_size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GU_API void
|
GU_API void
|
||||||
|
|||||||
Reference in New Issue
Block a user