summaryrefslogtreecommitdiff
path: root/runtest-moduleapi
diff options
context:
space:
mode:
authorViktor Söderqvist <viktor.soderqvist@est.tech>2021-09-14 16:48:06 +0200
committerGitHub <noreply@github.com>2021-09-14 17:48:06 +0300
commitea36d4de17101f05b03d267a4afbae0f7b33a27c (patch)
treec51e89d23d286f768314a9f9e4a3cdc27c3098c7 /runtest-moduleapi
parent1376d83363cf0e9c9f872762854518b16d8cedef (diff)
downloadredis-ea36d4de17101f05b03d267a4afbae0f7b33a27c.tar.gz
Modules: Add remaining list API functions (#8439)
List functions operating on elements by index: * RM_ListGet * RM_ListSet * RM_ListInsert * RM_ListDelete Iteration is done using a simple for loop over indices. The index based functions use an internal iterator as an optimization. This is explained in the docs: ``` * Many of the list functions access elements by index. Since a list is in * essence a doubly-linked list, accessing elements by index is generally an * O(N) operation. However, if elements are accessed sequentially or with * indices close together, the functions are optimized to seek the index from * the previous index, rather than seeking from the ends of the list. * * This enables iteration to be done efficiently using a simple for loop: * * long n = RM_ValueLength(key); * for (long i = 0; i < n; i++) { * RedisModuleString *elem = RedisModule_ListGet(key, i); * // Do stuff... * } ```
Diffstat (limited to 'runtest-moduleapi')
-rwxr-xr-xruntest-moduleapi1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtest-moduleapi b/runtest-moduleapi
index f9dbcce61..2dc835a84 100755
--- a/runtest-moduleapi
+++ b/runtest-moduleapi
@@ -36,6 +36,7 @@ $TCLSH tests/test_helper.tcl \
--single unit/moduleapi/defrag \
--single unit/moduleapi/hash \
--single unit/moduleapi/zset \
+--single unit/moduleapi/list \
--single unit/moduleapi/stream \
--single unit/moduleapi/datatype2 \
"${@}"