summaryrefslogtreecommitdiff
path: root/lib/yang.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-11-08 16:30:46 +0200
committerGitHub <noreply@github.com>2023-11-08 16:30:46 +0200
commit448f75e56d0792aa44a321e83825c28534d1af18 (patch)
treeef59987e7a2dfab5039cd923908fa8f40087e46e /lib/yang.c
parent85a80ba5aab3bb0fdffe6b17de8b5c09de66d985 (diff)
parentbec10915a4a36c392145c6d9013904a928cf7855 (diff)
Merge pull request #14525 from LabNConsulting/chopps/mgmtd-simplify-xpaths
chopps/mgmtd simplify xpaths
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/yang.c b/lib/yang.c
index 4dd8654217..7046091baa 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -254,15 +254,8 @@ struct lysc_node *yang_find_snode(struct ly_ctx *ly_ctx, const char *xpath,
uint32_t options)
{
struct lysc_node *snode;
- struct ly_set *set;
- LY_ERR err;
- err = lys_find_xpath(ly_native_ctx, NULL, xpath, options, &set);
- if (err || !set->count)
- return NULL;
-
- snode = set->snodes[0];
- ly_set_free(set, NULL);
+ snode = (struct lysc_node *)lys_find_path(ly_ctx, NULL, xpath, 0);
return snode;
}