aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/heap.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-10 13:43:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-10 13:44:07 +0100
commitdb6676684a4a8f961e8ada8f627d4b178e0e1669 (patch)
treeaba2f1662165e232b661fbaf3d86090b915527e8 /src/libutil/heap.c
parentef763f948579fa1b3d227df571688896c2a900e3 (diff)
downloadrspamd-db6676684a4a8f961e8ada8f627d4b178e0e1669.tar.gz
rspamd-db6676684a4a8f961e8ada8f627d4b178e0e1669.zip
[Minor] Add rspamd_min_heap_index helper method
Diffstat (limited to 'src/libutil/heap.c')
-rw-r--r--src/libutil/heap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/heap.c b/src/libutil/heap.c
index 9bcfd4f1d..115b2e6a8 100644
--- a/src/libutil/heap.c
+++ b/src/libutil/heap.c
@@ -179,3 +179,12 @@ rspamd_min_heap_destroy (struct rspamd_min_heap *heap)
g_slice_free1 (sizeof (*heap), heap);
}
}
+
+struct rspamd_min_heap_elt*
+rspamd_min_heap_index (struct rspamd_min_heap *heap, guint idx)
+{
+ g_assert (heap != NULL);
+ g_assert (idx >= 0 && idx < heap->ar->len);
+
+ return g_ptr_array_index (heap->ar, idx);
+}