]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
stasis: switch stasis show topics temporary container from list - RBtree
authorphoneben <3232963@gmail.com>
Tue, 11 Nov 2025 17:00:56 +0000 (19:00 +0200)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 12 Nov 2025 22:22:12 +0000 (22:22 +0000)
switch stasis show topics temporary container from list to RB-tree
minimizing lock time

Resolves: #1585

main/stasis.c

index 87805065eaf2a4df3bc0ec17fe2183a38a9d898c..6f5ab019f7cd7b849aee2e9867072f3e149f89db 100644 (file)
@@ -2434,10 +2434,10 @@ static char *stasis_show_topics(struct ast_cli_entry *e, int cmd, struct ast_cli
 
        ast_cli(a->fd, "\n" FMT_HEADERS, "Name", "Detail");
 
-       tmp_container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0,
+       tmp_container = ao2_container_alloc_rbtree(AO2_ALLOC_OPT_LOCK_NOLOCK, 0,
                                topic_proxy_sort_fn, NULL);
 
-       if (!tmp_container || ao2_container_dup(tmp_container, topic_all, OBJ_SEARCH_OBJECT)) {
+       if (!tmp_container || ao2_container_dup(tmp_container, topic_all, 0)) {
                ao2_cleanup(tmp_container);
 
                return NULL;