Skip to content

Commit 5df5c3e

Browse files
author
Artur Zakirov
committed
Use updated API to work with iterators in the Red-Black Tree
1 parent 4fd473d commit 5df5c3e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

rum.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,9 @@ typedef struct
743743
RumEntryAccumulator *entryallocator;
744744
uint32 eas_used;
745745
RBTree *tree;
746+
#if PG_VERSION_NUM >= 100000
747+
RBTreeIterator tree_walk;
748+
#endif
746749
RumKey *sortSpace;
747750
uint32 sortSpaceN;
748751
} BuildAccumulator;

rumbulk.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ qsortCompareRumKey(const void *a, const void *b, void *arg)
272272
void
273273
rumBeginBAScan(BuildAccumulator *accum)
274274
{
275+
#if PG_VERSION_NUM >= 100000
276+
rb_begin_iterate(accum->tree, LeftRightWalk, &accum->tree_walk);
277+
#else
275278
rb_begin_iterate(accum->tree, LeftRightWalk);
279+
#endif
276280
}
277281

278282
/*
@@ -288,7 +292,11 @@ rumGetBAEntry(BuildAccumulator *accum,
288292
RumEntryAccumulator *entry;
289293
RumKey *list;
290294

295+
#if PG_VERSION_NUM >= 100000
296+
entry = (RumEntryAccumulator *) rb_iterate(&accum->tree_walk);
297+
#else
291298
entry = (RumEntryAccumulator *) rb_iterate(accum->tree);
299+
#endif
292300

293301
if (entry == NULL)
294302
return NULL; /* no more entries */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy